Skip to content

Lightweight Python tool to generate Entity-Relationship Diagrams (ERDs) with Graphviz. Define entities, attributes, and relationships, then export clean diagrams to PNG, SVG, or PDF. Ideal for database modeling, documentation, and quick visualizations.

License

Notifications You must be signed in to change notification settings

mohammedhashim790/PyERDGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERD Builder

A Python-based Entity-Relationship Diagram (ERD) builder that generates visual representations of database schemas using GraphViz.

Components

Entity

An entity represents a real-world object or concept that can be distinctly identified. In database terms, it typically becomes a table. Examples include:

  • Users
  • Products
  • Orders

Attributes

Attributes are properties that describe an entity. For example, a User entity might have:

  • id (primary key)
  • username
  • email
  • password

Relationships

Relationships define how entities are connected to each other. Supported cardinalities include:

  • One-to-One (1:1)
  • One-to-Many (1:N)
  • Many-to-One (N:1)
  • Many-to-Many (M:N)

Dependencies

The project requires the following packages:

  • Python 3.9.6 or higher
  • graphviz: For generating the visual diagrams
  • virtualenv: For managing the Python environment

Additionally, you need to install the GraphViz system package:

  • On Ubuntu/Debian: sudo apt-get install graphviz
  • On macOS: brew install graphviz
  • On Windows: Download from the GraphViz website

Example

The example code can be found in example.py.

Generated Output

Example.png Example.SVG

License

MIT License
Copyright (c) 2021

About

Lightweight Python tool to generate Entity-Relationship Diagrams (ERDs) with Graphviz. Define entities, attributes, and relationships, then export clean diagrams to PNG, SVG, or PDF. Ideal for database modeling, documentation, and quick visualizations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages