python-general-be-lib
Libreria backend general purpose per progetti Python: repository CRUD e spaziali su SQLAlchemy / GeoAlchemy2, eccezioni FastAPI, modelli base Pydantic e utility di logging.
- Distribuzione PyPI:
python-general-be-lib - Pacchetto importabile:
general - Python richiesto: 3.12+
pip install python-general-be-lib
from sqlalchemy import create_engine
from general.interface.repository.crud_repository import CrudRepository
engine = create_engine("postgresql://user:pass@localhost/db")
repo = CrudRepository(entity=User, model=UserModel, engine=engine)
repo.insert(models=[UserModel(name="Mario", email="mario@example.com")])
repo.find(active=True, order_by="name", asc=True)
Cosa contiene
| Area | Componenti |
|---|---|
| Repository ORM | CrudRepository, GeometryRepository, ManyToManyRepository, ViewRepository |
| Layer Core (senza ORM) | CrudMetadata, GeomMetadata — CRUD e query spaziali su Table riflesse |
| Motore di filtraggio | StatementManager + BaseHandler, JsonHandler, ILikeHandler, JsonILikeHandler, OrHandler, IntervalHandler |
| Basi | Base (declarative base estesa), ExtBaseModel, CamelExtBaseModel |
| Paginazione | PaginatorRequestModel, PaginatorResponseModel |
| Eccezioni | ExceptionInterface e sottoclassi HTTP (400/401/403/404/422/500/503) |
| Logging | init_logger, decorator @log |
Documentazione
Il codice della libreria vive nella directory general/, che è un git
submodule (novatellus/shared-be-libs).
Questo repository esterno è il wrapper di packaging e pubblicazione.
- general/README.md — panoramica, quickstart, contratto di sessione, handler, operazioni spaziali
- general/DOCS.md — riferimento completo di ogni metodo
Dopo il clone, inizializza il submodule:
git submodule update --init --recursive
Build e pubblicazione
La versione è definita in entrambi setup.py e pyproject.toml: vanno
aggiornati insieme. I messaggi di commit sono prefissati con la nuova versione
(es. 0.7.2 OrHandler e distinct_pairs).
python3 setup.py sdist bdist_wheel # build di sdist + wheel in dist/
python3 -m twine upload dist/* # pubblicazione su PyPI
Licenza
MIT — vedi LICENSE.
Release files for python-general-be-lib 0.8.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 | |
|---|---|---|---|
| python_general_be_lib-0.8.0.tar.gz | 41.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_general_be_lib-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 94.7 kB
Release files / python_general_be_lib-0.8.0.tar.gz
| Download URL | python_general_be_lib-0.8.0.tar.gz |
|---|---|
| Size | 41.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80ed47417fe14f88e708d8f956e1242ee3c6cf35609df5a796fe73f21fe7d67a
|
|
BLAKE2b-256 checksum How to use checksums |
e08ae50a8255302cf536a1ba1552effd6c933fa77299de7eb373d6fc00a9fe22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / python_general_be_lib-0.8.0-py3-none-any.whl
| Download URL | python_general_be_lib-0.8.0-py3-none-any.whl |
|---|---|
| Size | 53.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
065ed7feb22f7f7808154fc53e428310a5bc12e7ab2444415b9e813000342349
|
|
BLAKE2b-256 checksum How to use checksums |
d98e97a1d5825898096c83afa1d9c0356da50ab11ce17a41780a43c25caa050f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|