Metadata-Version: 2.4
Name: pycrontask
Version: 0.1.1
Summary: Python background jobs with a decorator — no Redis, no Celery
Keywords: async,asyncpg,background jobs,celery,cron,fastapi,scheduler
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: asyncpg>=0.30.0
Requires-Dist: croniter>=3.0.3
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: respx>=0.21.0; extra == 'dev'
Description-Content-Type: text/markdown

# crontask

Python background jobs with a decorator — no Redis, no Celery.

```python
pip install pycrontask
```

```python
from contextlib import asynccontextmanager
from fastapi import FastAPI
import crontask

ct = crontask.init(
    api_key="...",
    database_url="postgresql://...",
    base_url="https://api.crontask.dev",
)

@ct.job(schedule="0 9 * * *")
async def send_daily_report():
    await do_the_work()

@asynccontextmanager
async def lifespan(app: FastAPI):
    await ct.start()
    yield

app = FastAPI(lifespan=lifespan)
```

Works with `async def` and regular `def` functions. Failure alerts by email. Dashboard at [crontask.dev](https://crontask.dev).
