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.1

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.1
File Size Uploaded Provenance
duck_domain_django_kit-0.1.1.tar.gz 28.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 74.6 kB

Release files / duck_domain_django_kit-0.1.1.tar.gz

Download URL duck_domain_django_kit-0.1.1.tar.gz
Size 28.2 kB
Tags Source
SHA-256 checksum
How to use checksums
31d557ff24cc7f000018c574d7c1afdf6614aabda0c9ecfa372769b5e73ca00d
BLAKE2b-256 checksum
How to use checksums
ddb2a33ef8e0a8020a34e5f6a1fd8e9ce98955a88a5ae5af9f3899b7fe4c2a06
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.1-py3-none-any.whl

Download URL duck_domain_django_kit-0.1.1-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c0fecad242a11d136ab79aeb314df516ce08ac0fddbe161f3ce2ff9c3435fc4
BLAKE2b-256 checksum
How to use checksums
b004441dfd5e31705d0e26d72ae6bddd5b3b421f767e38d0a663959a43ad145f
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.1

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