Skip to main content

The 'remix' your architecture needs: NestJS-style modularity, native async performance, and rigorous typing for Python 3.13+. 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.13+. 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.5.2.tar.gz (81.6 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.5.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dijay-0.5.2.tar.gz
  • Upload date:
  • Size: 81.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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.5.2.tar.gz
Algorithm Hash digest
SHA256 b5ff919374914a56c5e4164faa1023ecbcdd93000df6b40716cf7663e0a68f54
MD5 13d6f78d2707a87ebc0de807d0899d42
BLAKE2b-256 3ec5eb1fc7ae9be8b99934132a4e4fd2e897867d59a9de3060365064856c958d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dijay-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24b032a0f817535fae77e092ee53cc4ccc4b04e69ca314e4bf3312f2c112e463
MD5 7d5638591cf197897a7b8b94350310a9
BLAKE2b-256 276ec071694aa1d0c19abe2fe9a92b83a39d848dc3017259488f69b9b8444463

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