Skip to main content

SQLAlchemy Repository for models

tests workflow

This project contains simple Repository pattern for SQLAlchemy models.
All you need to do is:

  1. Install this package python -m pip install sa-repository
  2. 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)

Source distribution for sa-repository 2.0.0
File Size Uploaded
sa_repository-2.0.0.tar.gz 49.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sa-repository 2.0.0
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page