SQLAlchemy Repository for models
This project contains simple Repository pattern for SQLAlchemy models.
All you need to do is:
- Install this package
python -m pip install sa-repository - Use it in your project
from sa_repository import BaseRepository from models import YourSAModel class SomeModelRepository(BaseRepository[YourSAModel]): pass
Base class contains some general methods to simplify your work with sqlalchemy models e.x
var = SomeModelRepository(session).get(YourSAModel.attr == 'some_value')
If you don't want to create new repository classes, you can use get_repository_from_model method
repository = BaseRepository.get_repository_from_model(db_session, SomeModel)
Metadata
Release files for sa-repository 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sa_repository-2.0.0.tar.gz | 49.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sa_repository-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.8 kB
Release files / sa_repository-2.0.0.tar.gz
| Download URL | sa_repository-2.0.0.tar.gz |
|---|---|
| Size | 49.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10adc57bc3130ef8c8a0bf1439c8275fb4403e7590afeedcaefb88370a9c8134
|
|
BLAKE2b-256 checksum How to use checksums |
7dda11a3a0e89ddd36ec1b3c18deb016078cfda807fe9195b5d6db11eda54f7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / sa_repository-2.0.0-py3-none-any.whl
| Download URL | sa_repository-2.0.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc56b5e8cbabebea08d530ad40effa5eed4699a9c4210f6893552d93216a40f2
|
|
BLAKE2b-256 checksum How to use checksums |
b59bdc82ac676261930d72b9b47a97de65b5c152a1a8e499bbd06e43cc6b8fee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|