Skip to main content

🦆 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 the Null / NullOr[T] sentinel types for distinguishing "not sent" from None.
  • Repository pattern — IRepository interface and QueryResponse for ORM-agnostic data access.
  • Django repository/admin helpers — SoftDeleteModel, SoftDeleteDjangoRepository, SoftDeleteAdmin, get_if_active (lazily imported, only touch Django when actually used).
  • Relation loader — RelationLoader with FkRelationConfig, HasManyRelationConfig, M2MRelationConfig, M2MWithPivotRelationConfig to declaratively hydrate related data.
  • Errors — AppError, a structured application error base class.
  • Envs — IEnvs interface and a TOML-backed adapter for environment/settings configuration.
from dddk import (
    BaseDto,
    IRepository,
    WhereDto,
    QueryResponse,
    AppError,
)

🧑‍💻 Development

make help
  • make format — pyupgrade, autoflake, isort, black
  • make check — bandit, black, isort, flake8, mypy
  • make test — pytest
  • make pub — bump patch version, build and publish to PyPI

Metadata

Release files for duck-domain-django-kit 0.1.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 duck-domain-django-kit 0.1.0
File Size Uploaded Provenance
duck_domain_django_kit-0.1.0.tar.gz 28.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for duck-domain-django-kit 0.1.0
File Interpreter ABI Platform
duck_domain_django_kit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.6 kB

Release files / duck_domain_django_kit-0.1.0.tar.gz

Download URL duck_domain_django_kit-0.1.0.tar.gz
Size 28.2 kB
Tags Source
SHA-256 checksum
How to use checksums
639dd8a47406a701e2d7e67b096bdd27019e84cb138897e5c8f66ab317b4907f
BLAKE2b-256 checksum
How to use checksums
d8181e17f26a691fd15004c5a6fcce226c680410d80607b664c67e1036651005
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.1.0-py3-none-any.whl

Download URL duck_domain_django_kit-0.1.0-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0279f57d25ab9a86cdf5aff5e58067d242992e184feaa5e194b7ae6e183e3ced
BLAKE2b-256 checksum
How to use checksums
c12d61ebe42d62f95dd34fa39cb48b28d92e2316e92039070db211a495f48d93
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.1.0

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.

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