A Pydantic(+) model generator for Supabase
Project description
Supabase Pydantic Schemas
A project for generating Pydantic (& other) models from Supabase (& other) databases. Currently, this is ideal for integrating FastAPI with supabase-py as a primary use-case, but more updates are coming! This project is a inspired by the TS type generating capabilities of supabase cli. Its aim is to provide a similar experience for Python developers.
Installation
$ pip install supabase-pydantic # install
$ touch .env # create .env file
$ echo "DB_NAME=<your_db_name>" >> .env # add your postgres db name
$ echo "DB_USER=<your_db_user>" >> .env # add your postgres db user
$ echo "DB_PASS=<your_db_password>" >> .env # add your postgres db password
$ echo "DB_HOST=<your_db_host>" >> .env # add your postgres db host
$ echo "DB_PORT=<your_db_port>" >> .env # add your postgres db port
Usage
Generate Pydantic models for FastAPI:
$ sb-pydantic gen --type pydantic --framework fastapi --local
PostGres connection is open.
PostGres connection is closed.
Generating FastAPI Pydantic models...
FastAPI Pydantic models generated successfully: /path/to/your/project/entities/fastapi/schemas.py
File formatted successfully: /path/to/your/project/entities/fastapi/schemas.py
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
supabase_pydantic-0.6.1.tar.gz
(22.6 kB
view hashes)
Built Distribution
Close
Hashes for supabase_pydantic-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e19cad35bf6eefc78d3c28b7c3f7ab85c4742213182a800e82854dae7efe14b4 |
|
MD5 | e84cfbc0f1bcea46a111f2ba504e4329 |
|
BLAKE2b-256 | f20706dca0322b82c77acb03632cf1e588beb2fe648b0d1d9b8d902dc388c2d5 |