Database configuration and utilities for FastAPI with SQLAlchemy
Project description
rodrigo0000-fastapi-core-database
Database configuration and utilities for FastAPI with SQLAlchemy.
Features
- SQLAlchemy database setup and configuration
- Database session management
- Database initialization utilities
- Security utilities (JWT, password hashing)
- Repository pattern base classes
Installation
pip install rodrigo0000-fastapi-core-database
Usage
from rodrigo0000_fastapi_core_database import get_db, Base, engine, init_db
from rodrigo0000_fastapi_core_database import create_access_token, verify_password
# Initialize database
init_db()
# Use in FastAPI dependencies
from fastapi import Depends
from sqlalchemy.orm import Session
@app.get("/items")
def get_items(db: Session = Depends(get_db)):
# Your code here
pass
Components
- Database: SQLAlchemy engine, session, and base configuration
- Init DB: Database initialization and superuser creation
- Security: JWT token creation, password hashing, user verification
- Repository: Base repository pattern for database operations
Requirements
- Python >= 3.8
- FastAPI >= 0.104.0
- SQLAlchemy >= 2.0.0
- Pydantic >= 2.0.0
- python-jose[cryptography] >= 3.3.0
- passlib[bcrypt] >= 1.7.4
License
MIT License
Author
R Firm - Professional SaaS Development
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rodrigo0000_fastapi_core_database-1.0.2.tar.gz.
File metadata
- Download URL: rodrigo0000_fastapi_core_database-1.0.2.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
075f8f7561a4b922eae2d830122b5c50dca54e5e368811eec0aeb3aa224bdb4a
|
|
| MD5 |
dd53a981315a2ef65c1061282feb4d80
|
|
| BLAKE2b-256 |
3b254ebf8543c01b436b849888a102a0d1f4fc607ddf3c004c9be5020200cb36
|
File details
Details for the file rodrigo0000_fastapi_core_database-1.0.2-py3-none-any.whl.
File metadata
- Download URL: rodrigo0000_fastapi_core_database-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdc74febadad27a8751801611d5f871e3717034ea59e8f2802f1a6ef89726eff
|
|
| MD5 |
a3319d3d760341bc668d137e4ea9727d
|
|
| BLAKE2b-256 |
5be959c82f24f7d3f3e6277d6e48cd29ff49b3caa73f88d6bb4d0eab9201eb3f
|