Basic sqlalchemy helpers
Project description
db4me
Basic sqlalchemy helpers
Installation
python -m pip install db4me
Usage
Include the database settings into your model and, at application start-up time, create the connection based on these settings.
from pydantic_settings import BaseSettings
from db4me import AllDatabaseSettings, get_engine
class AppSettings(BaseSettings):
# ...
database: AllDatabaseSettings = Field(
description="Database settings.",
)
# ...
settings = AppSettings()
engine = get_engine(settings.database)
Development
Start by creating a virtual environment and installing the dependencies.
If you have a make command available, you can run make init after
the virtual environment is created and activated. Otherwise, you can run
the following commands:
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .[dev]
On Windows, to be able to serve the documentation, you may also need to
install the cairo2 package:
pip install pipwin
pipwin install cairocffi
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 db4me-0.1.0.tar.gz.
File metadata
- Download URL: db4me-0.1.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cecd9392a620467b7f1bc6a0ef19b5a8ba2c4865fa12da387b6c0c90f469c82f
|
|
| MD5 |
2c0aeae0892fc606cf7944aa9ff7c446
|
|
| BLAKE2b-256 |
46bde22c649abb3ffa3d7bc1bc800e6b5511ac1c1336e6329cfaa81e4a0c32b0
|
File details
Details for the file db4me-0.1.0-py3-none-any.whl.
File metadata
- Download URL: db4me-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
328159bb4de3267566da1d94a9d89262dc53f239b5ae17cbe5bebde2436b3f08
|
|
| MD5 |
5a62b468f298b5e68a026824aa4ef743
|
|
| BLAKE2b-256 |
14ae2d654239a857e709f84627ee8cbe8605b878e5f3adb4dffb45070c552a87
|