uncalled-for-0.3.1
توضیحات
Async dependency injection for Python functions
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | uncalled-for-0.3.1 |
| نام | uncalled-for |
| نسخه کتابخانه | 0.3.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Chris Guidry <guid@omg.lol> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/uncalled-for/ |
| مجوز | # Released under MIT License Copyright (c) 2025 Chris Guidry. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
# uncalled-for
Async dependency injection for Python functions.
Declare what your function needs as parameter defaults. They show up resolved
when the function runs. No ceremony, no container, no configuration.
```python
from uncalled_for import Depends
async def get_db():
db = await connect()
try:
yield db
finally:
await db.close()
async def handle_request(db: Connection = Depends(get_db)):
await db.execute("SELECT 1")
```
## Features
- **Zero dependencies** — standard library only
- **Async-native** — built on `AsyncExitStack` and `ContextVar`
- **Context manager lifecycle** — sync and async generators get proper cleanup
- **Nested dependencies** — dependencies can depend on other dependencies
- **Caching** — each dependency resolves once per call, even if referenced multiple times
## Install
```
pip install uncalled-for
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl uncalled-for-0.3.1:
pip install uncalled-for-0.3.1.whl
نصب پکیج tar.gz uncalled-for-0.3.1:
pip install uncalled-for-0.3.1.tar.gz