Python Forum
Better python library to create ER Diagram by using pandas data frames as tables
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Better python library to create ER Diagram by using pandas data frames as tables
#1
I'm looking for a better python library to create ER diagrams.

I want to input pandas tables as tables and then add relationships between tables.

I tried many libraries, finally found this "pandaserd" library but it doesn't create visualized diagram as file output, instead it require to paste the output code to another web page to generate the visual.

import pandaserd

# Create two DataFrames, one for each entity in the ERD
customer_df = pd.DataFrame({'id': [1, 2, 3], 'name': ['Alice', 'Bob', 'Carol']})
order_df = pd.DataFrame({'id': [1, 2, 3], 'customer_id': [1, 2, 3]})

# Create a pandaserd.ERD object
erd = pandaserd.ERD()

# Add the DataFrames to the ERD object
erd.add_table( customer_df,'Customer', bg_color='pink')
erd.add_table(order_df,'Order', bg_color='skyblue' )
 
# Specify the relationship between the entities
erd.create_rel('Customer', 'Order', left_on='id', right_on='customer_id', left_cardinality='*', right_cardinality='*')

erd.write_to_file('output.txt')
Output:
erd.write_to_file('output.txt') written to output.txt; visit https://edotor.net/ to render ERD
Is there a proper working python library to create ER diagrams as visual file with proper connectors?

Thanks in advance
Reply


Messages In This Thread
Better python library to create ER Diagram by using pandas data frames as tables - by klllmmm - Oct-19-2023, 01:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: Diagram.render() takes 1 positional argument but 2 were given sachin1361 0 239 Apr-23-2024, 06:39 AM
Last Post: sachin1361
  Create X Number of Variables and Assign Data RockBlok 8 1,027 Nov-14-2023, 08:46 AM
Last Post: perfringo
  Using pyodbc&pandas to load a Table data to df tester_V 3 863 Sep-09-2023, 08:55 PM
Last Post: tester_V
  Is there a more elegant way to concatenate data frames? db042190 3 978 Jun-13-2023, 05:08 PM
Last Post: snippsat
  Questions regarding usage of pandas library Pala 5 1,121 Apr-26-2023, 10:21 PM
Last Post: deanhystad
  googletrans library to translate text language for using data frame is not running gcozba2023 0 1,262 Mar-06-2023, 09:50 AM
Last Post: gcozba2023
  Create simple live plot of stock data dram 2 2,975 Jan-27-2023, 04:34 AM
Last Post: CucumberNox
  Create a function for writing to SQL data to csv mg24 4 1,224 Oct-01-2022, 04:30 AM
Last Post: mg24
  [Solved by deanhystad] Create a zip file using zipfile library DZ_Galaxy 2 1,214 Aug-17-2022, 04:57 PM
Last Post: DZ_Galaxy
Sad pandas writer create "corrupted" file freko75 1 2,872 Jun-14-2022, 09:57 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020