Persistence library for the Baobab AI development ecosystem.
Project description
baobab-ai-dev-database
Librairie de persistance de l'écosystème baobab-ai-development.
Le module fournit la configuration database, les sessions et transactions, les modèles ORM, les mappers, les repositories, les migrations Alembic et les services de lecture nécessaires aux workflows de développement IA.
Prérequis
- Python 3.12 ou supérieur
- pip
Installation
Depuis PyPI
python -m pip install baobab-ai-dev-database
L'installation standard cible PostgreSQL et résout :
baobab-ai-dev-core>=0.2,<1(version PyPI courante : 0.2.0)baobab-database[postgresql]>=2,<3(version PyPI courante : 2.0.0)alembic>=1,<2
Développement (dépôt local)
python -m pip install -e ".[dev]"
Usage de base
Configuration et session
Les variables d'environnement BAOBAB_DB_* pilotent la connexion (voir
.env.example et docs/configuration/environment-variables.md).
from baobab_ai_dev_database.config.database_settings import DatabaseSettings
from baobab_ai_dev_database.session.database_session_manager import DatabaseSessionManager
settings = DatabaseSettings().build()
manager = DatabaseSessionManager.from_settings(settings)
with manager.create_session() as session:
# utiliser la session SQLAlchemy
pass
Repositories
from baobab_ai_dev_database.repositories.repository_registry import RepositoryRegistry
registry = RepositoryRegistry(session)
project = registry.projects.get_by_slug("mon-projet")
Migrations Alembic
Les scripts de migration sont embarqués dans le wheel (env.py,
script.py.mako, révisions sous versions/).
Le fichier alembic.ini à la racine de ce dépôt n'est pas publié sur PyPI :
l'application consommatrice fournit sa propre configuration Alembic. Pointez
script_location vers le répertoire packagé :
from baobab_ai_dev_database.migrations import MIGRATIONS_SCRIPT_LOCATION
print(MIGRATIONS_SCRIPT_LOCATION)
Exemple minimal de section [alembic] côté consommateur :
[alembic]
script_location = %(CHEMIN_VERS_MIGRATIONS_SCRIPT_LOCATION)s
Dans ce dépôt (développement), exécuter depuis la racine :
alembic upgrade head
alembic current
Documentation détaillée : docs/technical/alembic-migrations.md.
Validation
Quality gate agrégée et multiplateforme (sans shell) :
python -m baobab_ai_dev_database.quality
Commandes individuelles :
python -m pytest
coverage run -m pytest
coverage report
ruff check .
mypy backend/src
La documentation de l'arborescence interne et de la quality gate se trouve dans
backend/README.md.
Publication PyPI (Trusted Publishing)
Le workflow .github/workflows/release.yml publie
sur PyPI via OIDC (aucun token longue durée dans le dépôt).
Configuration côté PyPI (une fois par projet) :
- Compte PyPI → Publishing → Add a new pending publisher
- PyPI project name :
baobab-ai-dev-database - Owner :
baobabgit(organisation GitHub du dépôt) - Repository name :
baobab-ai-dev-database - Workflow name :
release.yml - Environment name :
pypi
Créer ensuite l'environnement pypi dans les paramètres GitHub du dépôt
(Settings → Environments) avant de pousser un tag v*.*.*.
Versionnement
- Version actuelle du package : 0.1.0 (alpha).
- Historique :
CHANGELOG.md.
Licence
MIT — voir LICENSE.
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 baobab_ai_dev_database-0.1.0.tar.gz.
File metadata
- Download URL: baobab_ai_dev_database-0.1.0.tar.gz
- Upload date:
- Size: 65.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d083cf84e398362b69797f61a05cdcbe8912e920fbfb81590867ac8bf5907693
|
|
| MD5 |
096d8d682dc92b5b9e133af0d46b3390
|
|
| BLAKE2b-256 |
c33693d7d49065c399c661b0ba839e6d3ca05acd3d9d52a931019487ab612331
|
Provenance
The following attestation bundles were made for baobab_ai_dev_database-0.1.0.tar.gz:
Publisher:
release.yml on baobabgit/baobab-ai-dev-database
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baobab_ai_dev_database-0.1.0.tar.gz -
Subject digest:
d083cf84e398362b69797f61a05cdcbe8912e920fbfb81590867ac8bf5907693 - Sigstore transparency entry: 1823076588
- Sigstore integration time:
-
Permalink:
baobabgit/baobab-ai-dev-database@511538a05fe179bfb9cebfb261f6d39e40573b98 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/baobabgit
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@511538a05fe179bfb9cebfb261f6d39e40573b98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file baobab_ai_dev_database-0.1.0-py3-none-any.whl.
File metadata
- Download URL: baobab_ai_dev_database-0.1.0-py3-none-any.whl
- Upload date:
- Size: 115.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d91c94bc03602fde2d1fa9059b711670e9334735f2cdb47abc20722e03f41c6
|
|
| MD5 |
2a95fc5a2d0d0c9fc462f87107ddbb41
|
|
| BLAKE2b-256 |
441a9138d69c10633baa51b7425b62b4cacfedfacef8327b41166ac9f5c5fd28
|
Provenance
The following attestation bundles were made for baobab_ai_dev_database-0.1.0-py3-none-any.whl:
Publisher:
release.yml on baobabgit/baobab-ai-dev-database
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baobab_ai_dev_database-0.1.0-py3-none-any.whl -
Subject digest:
4d91c94bc03602fde2d1fa9059b711670e9334735f2cdb47abc20722e03f41c6 - Sigstore transparency entry: 1823076730
- Sigstore integration time:
-
Permalink:
baobabgit/baobab-ai-dev-database@511538a05fe179bfb9cebfb261f6d39e40573b98 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/baobabgit
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@511538a05fe179bfb9cebfb261f6d39e40573b98 -
Trigger Event:
push
-
Statement type: