pydocket-0.9.2


توضیحات

A distributed background task system for Python functions
ویژگی مقدار
سیستم عامل OS Independent
نام فایل pydocket-0.9.2
نام pydocket
نسخه کتابخانه 0.9.2
نگهدارنده []
ایمیل نگهدارنده []
نویسنده -
ایمیل نویسنده Chris Guidry <guid@omg.lol>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/pydocket/
مجوز # 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.
Docket is a distributed background task system for Python functions with a focus on the scheduling of future work as seamlessly and efficiently as immediate work. [![PyPI - Version](https://img.shields.io/pypi/v/pydocket)](https://pypi.org/project/pydocket/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pydocket)](https://pypi.org/project/pydocket/) [![GitHub main checks](https://img.shields.io/github/check-runs/chrisguidry/docket/main)](https://github.com/chrisguidry/docket/actions/workflows/ci.yml) [![Codecov](https://img.shields.io/codecov/c/github/chrisguidry/docket)](https://app.codecov.io/gh/chrisguidry/docket) [![PyPI - License](https://img.shields.io/pypi/l/pydocket)](https://github.com/chrisguidry/docket/blob/main/LICENSE) [![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://docket.lol/) ## At a glance ```python from datetime import datetime, timedelta, timezone from docket import Docket async def greet(name: str, greeting="Hello") -> None: print(f"{greeting}, {name} at {datetime.now()}!") async with Docket() as docket: await docket.add(greet)("Jane") now = datetime.now(timezone.utc) soon = now + timedelta(seconds=3) await docket.add(greet, when=soon)("John", greeting="Howdy") ``` ```python from docket import Docket, Worker async with Docket() as docket: async with Worker(docket) as worker: worker.register(greet) await worker.run_until_finished() ``` ``` Hello, Jane at 2025-03-05 13:58:21.552644! Howdy, John at 2025-03-05 13:58:24.550773! ``` Check out our docs for more [details](https://docket.lol/), [examples](https://docket.lol/en/latest/getting-started/), and the [API reference](https://docket.lol/en/latest/api-reference/). ## Why `docket`? ⚡️ Snappy one-way background task processing without any bloat 📅 Schedule immediate or future work seamlessly with the same interface ⏭️ Skip problematic tasks or parameters without redeploying 🌊 Purpose-built for Redis streams 🧩 Fully type-complete and type-aware for your background task functions 💉 Dependency injection like FastAPI, Typer, and FastMCP for reusable resources ## Installing `docket` Docket is [available on PyPI](https://pypi.org/project/pydocket/) under the package name `pydocket`. It targets Python 3.10 or above. With [`uv`](https://docs.astral.sh/uv/): ```bash uv pip install pydocket or uv add pydocket ``` With `pip`: ```bash pip install pydocket ``` Docket requires a [Redis](http://redis.io/) server with Streams support (which was introduced in Redis 5.0.0). Docket is tested with: - Redis 6.2, 7.4, and 8.6 (standalone and cluster modes) - [Valkey](https://valkey.io/) 8.1 - In-memory backend via [fakeredis](https://github.com/cunla/fakeredis-py) for testing For testing without Redis, use the in-memory backend: ```python from docket import Docket async with Docket(name="my-docket", url="memory://my-docket") as docket: # Use docket normally - all operations are in-memory ... ``` See [Testing with Docket](https://docket.lol/en/latest/testing/#using-in-memory-backend-no-redis-required) for more details. # Hacking on `docket` We use [`uv`](https://docs.astral.sh/uv/) for project management, so getting set up should be as simple as cloning the repo and running: ```bash uv sync ``` The to run the test suite: ```bash pytest ``` We aim to maintain 100% test coverage, which is required for all PRs to `docket`. We believe that `docket` should stay small, simple, understandable, and reliable, and that begins with testing all the dusty branches and corners. This will give us the confidence to upgrade dependencies quickly and to adapt to new versions of Redis over time. To work on the documentation locally: ```bash uv sync uv run zensical serve ``` This will start a local preview server. The docs are built with [Zensical](https://zensical.org/) and configured in `mkdocs.yml`.


نیازمندی

مقدار نام
- cloudpickle>=3.1.1
- cronsim>=2.6
ython_versio exceptiongroup>=1.2.0;
- fakeredis[lua]>=2.35.0
- opentelemetry-api>=1.33.0
- prometheus-client>=0.21.1
- py-key-value-aio[memory,redis]>=0.3.0
- python-json-logger>=2.0.7
- redis>=5
- rich>=13.9.4
ython_versio taskgroup>=0.2.2;
- typer>=0.15.1
- typing-extensions>=4.12.0
ys_platfor tzdata>=2025.2;
- uncalled-for>=0.2.0
xtr opentelemetry-sdk>=1.33.0;


زبان مورد نیاز

مقدار نام
>=3.10 Python


نحوه نصب


نصب پکیج whl pydocket-0.9.2:

    pip install pydocket-0.9.2.whl


نصب پکیج tar.gz pydocket-0.9.2:

    pip install pydocket-0.9.2.tar.gz