https://github.com/grillazz/fastapi-apscheduler
Simple REST interface to APScheduler library
https://github.com/grillazz/fastapi-apscheduler
apscheduler fastapi python python3 rest-api
Last synced: about 1 year ago
JSON representation
Simple REST interface to APScheduler library
- Host: GitHub
- URL: https://github.com/grillazz/fastapi-apscheduler
- Owner: grillazz
- License: mit
- Created: 2022-11-15T14:37:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-10T14:44:47.000Z (almost 2 years ago)
- Last Synced: 2025-05-12T02:11:16.918Z (about 1 year ago)
- Topics: apscheduler, fastapi, python, python3, rest-api
- Language: Python
- Homepage:
- Size: 244 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-apscheduler
[](https://travis-ci.com/viniciuschiele/fastapi-apscheduler)
[](https://badge.fury.io/py/fastapi-apscheduler)
[](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
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