{"id":13486663,"url":"https://github.com/ekiro/haps","last_synced_at":"2025-08-10T22:39:42.055Z","repository":{"id":57436731,"uuid":"89352161","full_name":"ekiro/haps","owner":"ekiro","description":"Pure Python dependency injection library","archived":false,"fork":false,"pushed_at":"2022-02-04T20:15:20.000Z","size":96,"stargazers_count":49,"open_issues_count":4,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-17T11:23:45.856Z","etag":null,"topics":["annotations","dependency-injection","python","python3"],"latest_commit_sha":null,"homepage":null,"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/ekiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-25T11:19:29.000Z","updated_at":"2025-03-06T13:04:46.000Z","dependencies_parsed_at":"2022-09-09T23:24:17.828Z","dependency_job_id":null,"html_url":"https://github.com/ekiro/haps","commit_stats":null,"previous_names":["ekiro/chaps"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/ekiro/haps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekiro%2Fhaps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekiro%2Fhaps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekiro%2Fhaps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekiro%2Fhaps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekiro","download_url":"https://codeload.github.com/ekiro/haps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekiro%2Fhaps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269799419,"owners_count":24477640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["annotations","dependency-injection","python","python3"],"created_at":"2024-07-31T18:00:49.659Z","updated_at":"2025-08-10T22:39:42.010Z","avatar_url":"https://github.com/ekiro.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# haps [![PyPI](https://badge.fury.io/py/haps.png)](https://pypi.python.org/pypi/haps/) [![Python application](https://github.com/lunarwings/haps/actions/workflows/python-app.yml/badge.svg?branch=master)](https://github.com/lunarwings/haps/actions/workflows/python-app.yml)\nHaps [χaps] is a simple DI library, with IoC container included. It is written in pure Python with no external dependencies.\n\nLook how easy it is to use:\n\n```python\nfrom haps import Container as IoC, Inject, inject\n\n# import interfaces\nfrom my_application.core import IDatabase, IUserService\n\n\nclass MyApp:\n    db: IDatabase = Inject()  # dependency as a property\n\n    @inject  # or passed to the constructor\n    def __init__(self, user_service: IUserService) -\u003e None:\n        self.user_service = user_service\n\nIoC.autodiscover('my_application')  # find all interfaces and implementations\n\nif __name__ == '__main__':\n    app = MyApp()\n    assert isinstance(app.db, IDatabase)\n    assert isinstance(app.user_service, IUserService)\n```\n\n# Installation\n\n    pip install haps\n\n# Documentation\n\nSee https://haps.readthedocs.io/en/latest/\n\n# Usage examples\n\nSee https://github.com/lunarwings/haps/tree/master/samples\n\n# Testing\n\nInstall `requirements.test.txt` and run `py.test` in main directory.\n\n# Changelog\n\n## 1.1.3 (2022-02-04)\n- Add `\u003e\u003e` operator\n- Add `DI` alias\n- ~~Update~~ Remove `.travis.yml`\n- Setup GitHub actions\n\n## 1.1.1 (2018-07-27)\n- Fix bug with optional arguments for functions decorated with `@inject`\n\n## 1.1.0 (2018-07-26)\n- Add configuration module\n- Add application class and runner\n- Add profiles\n- Minor fixes\n\n## 1.0.5 (2018-07-12)\n- `@egg` decorator can be used without function invocation\n\n## 1.0.4 (2018-06-30)\n- Add support for python 3.7\n- Fix autodiscover sample\n\n## 1.0.0 (2018-06-15)\n- First stable release\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekiro%2Fhaps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekiro%2Fhaps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekiro%2Fhaps/lists"}