Skip to main content

The 'remix' your architecture needs: NestJS-style modularity, native async performance, and rigorous typing for Python 3.14+. Less boilerplate, more harmony.

Project description

ci coverage release pypi license

🎧 dijay

Drop the beat on your dependencies.

dijay is the "remix" your architecture needs: NestJS-style modularity, native async performance, and rigorous typing for Python 3.14+. Less boilerplate, more harmony.

🚀 Features

  • Modular Architecture: Organize code into @modules with imports, providers, and exports.
  • Constructor Injection: Clean, testable injection via __init__ and Annotated.
  • Flexible Scopes: SINGLETON, TRANSIENT, and REQUEST.
  • Async Native: First-class support for asynchronous factories and lifecycle hooks.
  • Custom Providers: Provide dataclass for value, class and factory bindings.
  • Lifecycle Hooks: @on_bootstrap and @on_shutdown decorators.
  • Circular Dependency Detection: Immediate RuntimeError on cycles.

📦 Installation

uv add dijay

⚡ Quick Start

import asyncio
from dijay import Container, injectable, module

@injectable()
class CatsService:
    def get_all(self):
        return ["Meow", "Purr"]

@module(providers=[CatsService], exports=[CatsService])
class CatsModule: ...

@module(imports=[CatsModule])
class AppModule: ...

async def main():
    async with Container.from_module(AppModule) as container:
        service = await container.resolve(CatsService)
        print(service.get_all())

if __name__ == "__main__":
    asyncio.run(main())

📖 Documentation

For the full documentation — including guides on modules, providers, injection, lifecycle hooks, FastAPI integration, and the complete API reference — visit:

🔗 leandroluk.github.io/python-dijay

🛠️ Development

uv sync
uv run pytest
uv build

📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dijay-0.3.35.tar.gz (66.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dijay-0.3.35-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file dijay-0.3.35.tar.gz.

File metadata

  • Download URL: dijay-0.3.35.tar.gz
  • Upload date:
  • Size: 66.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dijay-0.3.35.tar.gz
Algorithm Hash digest
SHA256 6e0ab660f912507e1f1a3c4b9345ee6e7245326b9c8f500289b6113bb0fdbbe4
MD5 a53fb67adfb2f12c3999ccb79a5d0946
BLAKE2b-256 d365705a5cd2ca28ecddcf07028ffd2fe5f707ecb91ecd0a9f9af5da9a492a85

See more details on using hashes here.

File details

Details for the file dijay-0.3.35-py3-none-any.whl.

File metadata

  • Download URL: dijay-0.3.35-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dijay-0.3.35-py3-none-any.whl
Algorithm Hash digest
SHA256 539e5b6f4312d7d1d96544d9428fbfb16bf6a5c88bae3c0d298f270a8e00e569
MD5 bce9b86c7f19d83838615085dc2a3ecb
BLAKE2b-256 f0c6967e7dd133132e3ada4d99aed88b9b33459c33279be39486841a2a64572b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page