abcdi-config
A Python library for configuration-based dependency injection using the abcdi library. Define your application dependencies in YAML configuration files and automatically instantiate them with proper dependency injection.
Features
- Configuration-driven dependency injection
- YAML-based configuration files
- Factory pattern for creating instances
- Support for environment variable overrides
- Type safety with Pydantic validation
- Lazy dependency loading support
Installation
pip install abcdi-config
Quick Start
from pathlib import Path
from abcdi_config import load_configuration, configuration
from abcdi_config.schema import Config
# Load configuration from YAML file
load_configuration(Path("config.yaml"), Config)
# Access the loaded configuration
config = configuration()
# Get dependencies using abcdi
import abcdi
db = abcdi.get_dependency('database')
Configuration Format
dependencies:
database:
class_: sqlalchemy.create_engine
kwargs:
url: postgresql://user:pass@localhost/db
echo: true
api_client:
class_: requests.Session
kwargs:
timeout: 30
Development
This project uses uv for dependency management and virtual environments.
Setup
# Install dependencies
uv sync
# Or install dependencies into your existing virtualenv
uv pip sync requirements.txt dev-requirements.txt
Linting
Pylint
Pylint is configured with a focus on reducing false positives for test files while catching real issues in production code.
uv run pylint src/ tests/
MyPy
MyPy type checking is configured to skip third-party library stubs.
uv run mypy src/ tests/
Running Tests
uv run pytest tests/
Metadata
Release files for abcdi-config 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| abcdi_config-0.0.1.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abcdi_config-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / abcdi_config-0.0.1.tar.gz
| Download URL | abcdi_config-0.0.1.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0839857910d6c7ab7d957e6daac4945735db2657cd38743a489718af6db12b92
|
|
BLAKE2b-256 checksum How to use checksums |
b2b8ab2542b312c10e3a1d99c2db976add55327cefba941b9ff5ad868c09774d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / abcdi_config-0.0.1-py3-none-any.whl
| Download URL | abcdi_config-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83c17f07222807a24c8ef1e7a1b8b65c97c4fa96f5d259dbf9bade02dac2d692
|
|
BLAKE2b-256 checksum How to use checksums |
69c60e4e2008f08c7f34d936ee8b248548929c5775bcfd061f493c3c31bef76d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|