Create ERD diagrams from pandas dataframes.
Project description
Create ERD diagram from pandas dataframes
- use
convert_to_dot.py
to create anoutput.txt
file containing dot code - copy-paste the
output.txt
into a dot render like this one
Example usage:
import pandas as pd
from convert_to_dot import ERD
df1 = pd.DataFrame(data=[[123, 32, '1 Ottawa Street'], [123, 80, '14 Canada Road']])
df1.columns = ['PERSON', 'AGE', 'ADDRESS']
df2 = pd.DataFrame(data=[[6342, 124123124124, '1992-01-02', 'K012V4'], [3124, 154823124124, '1984-02-02', 'L4Y6S2']])
df2.columns = ['PERSON', 'CREDIT_CARD', 'DOB', 'POSTAL_CODE']
erd = ERD()
erd.add_table(df1, 'PERSON')
erd.add_table(df2, 'CREDIT_CARD')
erd.create_edge('PERSON', 'CREDIT_CARD', left_on='PERSON', right_on='PERSON', right_cardinality='*')
erd.write_to_file('output.txt')
Credits
Largely inspired by this fab repo!
- dot documentation can be found here
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pandaserd-0.1.1.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for pandaserd-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b3332949fdedb71cb78fab4d637e03125ea5acd93b6ee39d2d84b86c052cc9a |
|
MD5 | 8c72e854aab19b1987d35861c4128f1e |
|
BLAKE2b-256 | 753a7f800ff38118566e05ca6072c007d0df0264315d7b8291cd3112d2e839b6 |