Metadata-Version: 2.3
Name: jobify
Version: 0.5.2
Summary: A modern, lightweight and robust task manager with a user-friendly interface and a wide range of features, using the low-level asyncio API and more.
Keywords: jobs,cron,asyncio,cron-jobs,scheduler,scheduling,asynchronous,job-scheduler,task-scheduler,python-scheduler,background-tasks,background-jobs,delayed-tasks
Author: Sergey Yavorsky
Author-email: Sergey Yavorsky <maclovi.dev@gmail.com>
License: MIT
Classifier: Typing :: Typed
Classifier: Framework :: Pytest
Classifier: Framework :: AsyncIO
Classifier: Natural Language :: English
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Dist: crontab==1.0.5
Requires-Dist: tzdata==2025.2 ; sys_platform == 'win32'
Requires-Dist: typing-extensions>=4.12.0
Requires-Python: >=3.10, <5
Project-URL: Homepage, https://github.com/theseriff/jobify
Project-URL: Repository, https://github.com/theseriff/jobify
Project-URL: Documentation, https://github.com/theseriff/jobify/README.md
Project-URL: Changelog, https://github.com/theseriff/jobify/blob/main/docs/CHANGELOG.md
Project-URL: Issues, https://github.com/theseriff/jobify/issues
Description-Content-Type: text/markdown

<div align="center">

<h1>Jobify<br>Robust task scheduler.</h1>

[![Tests](https://github.com/theseriff/jobify/actions/workflows/pr_tests.yml/badge.svg)](https://github.com/theseriff/jobify/actions/workflows/pr_tests.yml)
[![Coverage](https://coverage-badge.samuelcolvin.workers.dev/theseriff/jobify.svg)](https://coverage-badge.samuelcolvin.workers.dev/redirect/theseriff/jobify)
[![Package version](https://img.shields.io/pypi/v/jobify?label=PyPI)](https://pypi.org/project/jobify)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/jobify.svg)](https://pypi.org/project/jobify)\
[![CodeQL](https://github.com/theseriff/jobify/actions/workflows/pr_codeql.yml/badge.svg)](https://github.com/theseriff/jobify/actions/workflows/pr_codeql.yml)
[![Dependency Review](https://github.com/theseriff/jobify/actions/workflows/pr_dependency_review.yml/badge.svg)](https://github.com/theseriff/jobify/actions/workflows/pr_dependency_review.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

</div>

---

**Documentation:** https://theseriff.github.io/jobify/

**Jobify** is a robust solution that was built from the ground up to handle asynchronous tasks. It offers a clean and modern API that is inspired by leading frameworks.

## Key features

- **Routing**: There are routers like in fastAPI/Starlette/Aiogram.
- **Schedule**: For cron, add two extra optional fields, `* * * * * * *`, for the second interval.
- **Lifespan**: The lifespan of the application is similar to that of FastAPI/Starlette.
- **Middleware**: Middleware such as fastAPI/Starlette/Aiogram.
- **Exception Handling**: Exception handling using fastAPI/Starlette.

---

## Quick Start

Install Jobify from PyPI:

```bash
pip install jobify
```

Here is a simple example of how to schedule and run a job:

```python
import asyncio
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo

from jobify import Jobify

UTC = ZoneInfo("UTC")
# 1. Initialize Jobify
app = Jobify(tz=UTC)


@app.task(cron="* * * * * * *")  # Runs every seconds
async def my_cron() -> None:
    print("Hello! cron running every seconds")


@app.task
def my_job(name: str) -> None:
    now = datetime.now(tz=UTC)
    print(f"Hello, {name}! job running at: {now!r}")


async def main() -> None:
    # 4. Run the Jobify application context
    async with app:
        run_next_day = datetime.now(tz=UTC) + timedelta(days=1)
        job_at = await my_job.schedule("Connor").at(run_next_day)
        job_delay = await my_job.schedule("Sara").delay(20)

        await job_at.wait()
        await job_delay.wait()

        # Or
        # It is blocked indefinitely because the cron has infinite planning.
        # await app.wait_all()


if __name__ == "__main__":
    asyncio.run(main())
```
