{"id":37085441,"url":"https://github.com/turborg/turbolightdi","last_synced_at":"2026-01-14T10:30:18.575Z","repository":{"id":331133128,"uuid":"1124372704","full_name":"turborg/turbolightdi","owner":"turborg","description":"TurboLightDI is a optimized Dependency Injection (DI) container engineered for speed and simplicity. Designed to deliver minimal overhead.","archived":false,"fork":false,"pushed_at":"2025-12-31T12:16:55.000Z","size":47,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T13:25:10.464Z","etag":null,"topics":["automation","clean-architecture","decorators","dependency-injection","design-patterns","high-performance","inversion-of-control","ioc-container","lightweight","microservices","pypi","python","singleton","software-architecture","solid-principles","testing","turbolightdi","turborg","turboroid","type-hints"],"latest_commit_sha":null,"homepage":"https://turborg.com/turbolightdi","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/turborg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-28T22:49:51.000Z","updated_at":"2025-12-31T12:16:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/turborg/turbolightdi","commit_stats":null,"previous_names":["turborg/turbolightdi"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/turborg/turbolightdi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turborg%2Fturbolightdi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turborg%2Fturbolightdi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turborg%2Fturbolightdi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turborg%2Fturbolightdi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/turborg","download_url":"https://codeload.github.com/turborg/turbolightdi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turborg%2Fturbolightdi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:25:19.714Z","status":"ssl_error","status_checked_at":"2026-01-14T10:22:49.371Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","clean-architecture","decorators","dependency-injection","design-patterns","high-performance","inversion-of-control","ioc-container","lightweight","microservices","pypi","python","singleton","software-architecture","solid-principles","testing","turbolightdi","turborg","turboroid","type-hints"],"created_at":"2026-01-14T10:30:15.870Z","updated_at":"2026-01-14T10:30:18.563Z","avatar_url":"https://github.com/turborg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://turborg.com/TurboLightDI\" target=\"_blank\"\u003e\n\u003cimg src=\"https://i.postimg.cc/TPTSD04k/turbolightdi.png\" alt=\"TurboLightDI Logo\" width=\"400px\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![CI \u0026 CD](https://github.com/turborg/turbolightdi/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/turborg/turbolightdi/actions/workflows/release.yml)\n[![Daily Health Check](https://github.com/turborg/turbolightdi/actions/workflows/test-daily.yml/badge.svg?branch=main)](https://github.com/turborg/turbolightdi/actions/workflows/test-daily.yml)\n![Python Versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue?style=flat-square)\n![Development Status](https://img.shields.io/badge/status-Alpha-orange?style=flat-square)\n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/turbolightdi?period=total\u0026units=INTERNATIONAL_SYSTEM\u0026left_color=GREY\u0026right_color=GREEN\u0026left_text=downloads)](https://pepy.tech/projects/turbolightdi)\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\nTurboLightDI is a lightweight, high-performance Inversion of Control container for Python.\n\u003c/p\u003e\n\n## Usage\n**TurboLightDI** uses a special hierarchy to manage your application's lifecycle. Components are divided into **External Components** and **Internal Logic**.\n\n### Install\n```bash\npip install turbolightdi\n```\n### Quick Example\n```python\nfrom TurboLightDI import cy, borg, service, repository\n\n@cy\nclass DatabaseConfig:\n    @borg\n    def session_factory(self) -\u003e Session:\n        return create_session_factory()\n\n@repository\nclass UserRepository(TurboquentRepository):\n    pass\n\n@service\nclass UserService:\n    def __init__(self, user_repository: UserRepository):\n        self.user_repository = user_repository\n```\n\n## About TurboLightDI\n\nTurboLightDI aims to provide elegant dependency injection using decorators and type hints, allowing you to build decoupled, testable, and maintainable applications.\n\nCore features:\n\n* Zero Configuration: Use standard Python decorators.\n* Constructor Injection: Automatic wiring based on Python type hints.\n* Lifecycle Management: Efficiently manages object lifecycles (singleton, prototype...)\n* Third-Party Support: Use `@borg` to inject objects from libraries like Redis, SQLAlchemy or any other third party lib.\n* Circular Dependency Detection: Built-in protection against recursive injections (for example, A → B, B → A).\n\n---\n## Development\n```bash\nuv venv --python 3.12\nuv pip install .[dev]\npre-commit install\n```\n\n### External Integration\nUse these decorators to integrate third-party libraries (like Redis, SQLAlchemy etc..) into your application.\n* **`@cy` (Configuration Yield)**: A class-level decorator for modules that house the configurations required to yield the objects your application needs.\n* **`@borg` (Bound Object Resource Graph)**: A method-level decorator used within a `@cy` class. It holds and registers third-party libraries as assimilated components in the DI graph.\n\n### Internal Logic (components)\nFor classes created within your own codebase, use the following decorators to enable auto DI:\n\n* **`@component`**: The base decorator for any general-purpose class managed by the TurboLightDIContainer.\n\n#### Specialized Components\nTo maintain clean architectural separation, use these specific aliases:\n\n| Decorator         | Role | Description                                                                                                                                                          |\n|:------------------| :--- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **`@controller`** | **REST APIs** | Entry points that orchestrate RESTful communication and handle incoming requests                                                                                     |\n| **`@service`**    | **Business Logic** | Encapsulates business logic.                                                                                                                                         |\n| **`@repository`** | **Data Access** | Communicates with data holders. Usually implements `TurboquentRepository`, providing a powerful abstraction layer for common DB operations with minimal boilerplate. |\n\n\n\n---\n*Part of the [**Turborg**](https://turborg.com) AI-First Open Source Suite Ecosystem*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturborg%2Fturbolightdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturborg%2Fturbolightdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturborg%2Fturbolightdi/lists"}