🦆 DuckDomainDjangoKit (dddk)
DuckDomainDjangoKit is a small set of domain and repository-layer building blocks for Django backends: typed DTOs, a repository interface, structured error handling, a FK/M2M/HasMany relation loader, and an environment-config abstraction. It's the extracted, reusable core shared across multiple Django projects.
It pairs naturally with DuckDI for dependency injection.
📦 Installation
With Poetry:
poetry add duck-domain-django-kit
Or using pip:
pip install duck-domain-django-kit
🚀 What's inside
- DTOs —
BaseDto,RequestDto,CreateDto,UpdateDto,WhereDto, plus theNull/NullOr[T]sentinel types for distinguishing "not sent" fromNone. - Repository pattern —
IRepositoryinterface andQueryResponsefor ORM-agnostic data access. - Django repository/admin helpers —
SoftDeleteModel,SoftDeleteDjangoRepository,SoftDeleteAdmin,get_if_active(lazily imported, only touch Django when actually used). - Relation loader —
RelationLoaderwithFkRelationConfig,HasManyRelationConfig,M2MRelationConfig,M2MWithPivotRelationConfigto declaratively hydrate related data. - Errors —
AppError, a structured application error base class. - Envs —
IEnvsinterface and an adapter exposing the database connection settings from theDATABASE_URLenvironment variable.
from dddk import (
BaseDto,
IRepository,
WhereDto,
QueryResponse,
AppError,
)
🧑💻 Development
make help
make format— pyupgrade, autoflake, isort, blackmake check— bandit, black, isort, flake8, mypymake test— pytestmake pub— bump patch version, build and publish to PyPI
Metadata
Release files for duck-domain-django-kit 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| duck_domain_django_kit-0.3.4.tar.gz | 28.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| duck_domain_django_kit-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.1 kB
Release files / duck_domain_django_kit-0.3.4.tar.gz
| Download URL | duck_domain_django_kit-0.3.4.tar.gz |
|---|---|
| Size | 28.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43dcf9e98c750226f0743f58039d549e2282538fee09ccbe4f0960cf5a2ff156
|
|
BLAKE2b-256 checksum How to use checksums |
5fc1d4c6bc41665b8dbc22a75be26aa0abf0a65025d89beb80824df1d31d0963
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.4 Darwin/24.0.0
|
Release files / duck_domain_django_kit-0.3.4-py3-none-any.whl
| Download URL | duck_domain_django_kit-0.3.4-py3-none-any.whl |
|---|---|
| Size | 45.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66c32df4178c55086e402d807125a69a4bd3b2eca3ed2b5fa0d0e9c89a32b06b
|
|
BLAKE2b-256 checksum How to use checksums |
acd113a414d4bdb95692a74fcd4fc4685edf7a925ff12f0e565fd9c0750a02f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.4 Darwin/24.0.0
|
Security for duck-domain-django-kit 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.