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 an adapter exposing the database connection settings from the DATABASE_URL environment variable.
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.3.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.3.1
File Size Uploaded Provenance
duck_domain_django_kit-0.3.1.tar.gz 27.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 72.6 kB

Release files / duck_domain_django_kit-0.3.1.tar.gz

Download URL duck_domain_django_kit-0.3.1.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4ad2a0dab435b8b1865c55853549564752da19d0da43086d64947b3c806dd727
BLAKE2b-256 checksum
How to use checksums
bd8fa136690433f981dc359c602fd45423f30957e221211cf1b702a6cbd64a14
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.1-py3-none-any.whl

Download URL duck_domain_django_kit-0.3.1-py3-none-any.whl
Size 44.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b14056f41221aed7d606939f44d21691a1965d00be956e6e16136cc28e6e3b54
BLAKE2b-256 checksum
How to use checksums
6ae68380a8bb5c6d051548300a7899b18d79476ab7071fe2f165179cd6e3710a
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.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