Skip to content

Personal starter kit/template for a Python project that includes a skeleton for environment variables, async database, and database migrations.

Notifications You must be signed in to change notification settings

kokopi-dev/python-async-database-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Async Database Template

Personal repo to spin up a Python project with scaffolding/template for utilizing an async database. Currently, it is using postgresql.


Features

  • Environment variables manager
  • Connection string via environment variables
  • UUID for IDs
  • SQLAlchemy Relationship Examples:
    • Foreign key (one-to-many)
    • Many-to-many

Setup

python -m venv venv
source venv/bin/activate
(venv) pip install -r requirements.txt

cp env .env

# setup postgresql database
# make sure your .env has the correct values for connection string
# complete your models
./migrate.sh add "message"
./migrate.sh run

Commands

./migrate.sh init
./migrate.sh add "initial migration"
./migrate.sh run
./migrate.sh revert

Deps

About

Personal starter kit/template for a Python project that includes a skeleton for environment variables, async database, and database migrations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published