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


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to remove unwanted images and tables from a Word file using Python? rownong 2 2,305 Feb-04-2025, 08:30 AM
Last Post: Pedroski55
  Is there a Python solution to select unique frames from a video? rownong 1 1,398 Feb-02-2025, 09:56 AM
Last Post: Larz60+
  TypeError: Diagram.render() takes 1 positional argument but 2 were given sachin1361 0 1,847 Apr-23-2024, 06:39 AM
Last Post: sachin1361
  Create X Number of Variables and Assign Data RockBlok 8 6,805 Nov-14-2023, 08:46 AM
Last Post: perfringo
  Using pyodbc&pandas to load a Table data to df tester_V 3 4,643 Sep-09-2023, 08:55 PM
Last Post: tester_V
  Is there a more elegant way to concatenate data frames? db042190 3 2,556 Jun-13-2023, 05:08 PM
Last Post: snippsat
  Questions regarding usage of pandas library Pala 5 2,805 Apr-26-2023, 10:21 PM
Last Post: deanhystad
  googletrans library to translate text language for using data frame is not running gcozba2023 0 4,188 Mar-06-2023, 09:50 AM
Last Post: gcozba2023
  Create simple live plot of stock data dram 2 4,571 Jan-27-2023, 04:34 AM
Last Post: CucumberNox
  Create a function for writing to SQL data to csv mg24 4 3,599 Oct-01-2022, 04:30 AM
Last Post: mg24

Forum Jump:

User Panel Messages

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