Metadata-Version: 2.1
Name: fastapi-apscheduler
Version: 0.0.7
Summary: Allow manage APScheduler with FastAPI router
Home-page: https://github.com/grillazz/fastapi-apscheduler
License: MIT
Author: Jakub Miazek
Author-email: the@grillazz.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Dist: APScheduler (>=3.10.4,<4.0.0)
Requires-Dist: fastapi[all] (>=0.112.0,<0.113.0)
Requires-Dist: gunicorn (>=22.0.0,<23.0.0)
Requires-Dist: typing-extensions (>=4.9.0,<5.0.0)
Project-URL: Repository, https://github.com/grillazz/fastapi-apscheduler
Description-Content-Type: text/markdown

# fastapi-apscheduler


[![Build Status](https://travis-ci.com/viniciuschiele/fastapi-apscheduler.svg?branch=main)](https://travis-ci.com/viniciuschiele/fastapi-apscheduler)
[![PyPI version](https://badge.fury.io/py/fastapi-apscheduler.svg)](https://badge.fury.io/py/fastapi-apscheduler)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
pip install fastapi-apscheduler
```

## Usage

```python
from fastapi import FastAPI

from fastapi_apscheduler.utils import get_logger
from fastapi_apscheduler.routers import get_jobs_router
from fastapi_apscheduler.scheduler import lifespan

logger = get_logger(__name__)

app = FastAPI(lifespan=lifespan)

app.include_router(get_jobs_router(), prefix="/scheduler", tags=["scheduler"])


async def pytest_job():
    logger.info("test_job")
```



## Build and publish to pypi with poetry
```bash
poetry build

Building fastapi-apscheduler (0.0.x)
  - Building sdist
  - Built fastapi_apscheduler-0.0.x.tar.gz
  - Building wheel
  - Built fastapi_apscheduler-0.0.x-py3-none-any.whl


poetry config pypi-token.pypi <token>


poetry publish

Publishing fastapi-apscheduler (0.0.6) to PyPI
 - Uploading fastapi_apscheduler-0.0.6-py3-none-any.whl 100%
 - Uploading fastapi_apscheduler-0.0.6.tar.gz 100%
```

## Run local instance of worker with uvicorn
```bash
uvicorn example.main:app --workers 1 --port 8084 --log-level debug --env-file example/.env
```

## TODO:
- add CI
- add tests to CI
- add coverage to CI
