Skip to main content

Creates database models from a database

Project description

PYDBModels v0.0.11

Database Models Generator

Generates Class models from database introspection

Usage

import pydbmodels

def main():
    pydbmodels.generate("postgres", "postgresql://postgres:postgres1@localhost:9876/postgres")

if __name__ == "__main__":
    main()

It Will create a _models folder with all the sub-folders representing different schema. In each schema folder, there will be a file representing a table, and in each table-file, three models, the database model the model initializer and the model updater

User defined Enums are supported and they will be placed in user_defined module as a string representation of the Postgres enum values

Generator

Generated models are Pydantic classes, but eventually other generators that implement IGenerator interface can be added.

Limitations

A lot. All supported types are the one that I actually need. I don't have a fully supported Database. This project also depends from dbmeta for database introspection that has its own limitations.

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

pydbmodels-0.0.10.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

pydbmodels-0.0.10-py2.py3-none-any.whl (12.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page