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
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 Distribution
Built Distribution
Hashes for pydbmodels-0.0.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35d8c076796bae7ef2f3152f149f454a048adda2ca596b4b48d3133eaa5e756e |
|
MD5 | aa54c50f225e9addf06e83e4f58e9035 |
|
BLAKE2b-256 | 6b41f01e5bf344c4d0984136ad7ae056c0fac140d0c3ea68bfc3510e0cde745b |