Generate ER diagrams with python and graphviz
Project description
Introduction
The packages allows you to programmatically create ER diagrams. The pacakges is simple, but it should help you generate ER diagrams like the one provided by Chen.
Installation
pip install yaerrrr
Example
A single ER can be generated as follows:
import yaerrrr
class TestEr(yaerrrr.AbstractYaerrrrScript):
def generate_er(self, context: 'yaerrrr.YaerrrContext') -> "yaerrrr.ErDiagram":
er = context.er
er.add_entity(name="authors", fields=[
er.generate_primary_id_key(),
])
er.add_entity(name="books", fields=[
er.generate_primary_id_key()
])
er.add_1_to_0_n("authors", "books", "writes")
return er
def main():
x = TestEr()
x.run("output.svg")
if __name__ == "__main__":
main()
and it outputs (for now):
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file yaerrrr-1.14.4-py3-none-any.whl
.
File metadata
- Download URL: yaerrrr-1.14.4-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 646ed3fb8a9531e903d6df0f8df08e357ae52e1b4f5714af18383330934b8f44 |
|
MD5 | 48141300e1ec67195008e136299f7ab0 |
|
BLAKE2b-256 | ca70d6313febc8c0c971b15ca80be51afc9a52ebb800e37cf560207636d345eb |