Reusable utilities for FastAPI
Project description
🎨⚡️🔥 Reusable Utilities for FastAPI
Source Code: https://github.com/priyanshu-panwar/fastapi-utilities
Inspired From: dmontagu/fastapi-utils
Features
This package includes a number of utilities to help reduce boilerplate and reuse common functionality across projects:
- Repeated Tasks: Easily trigger periodic tasks on server startup using repeat_every.
from fastapi_utilities import repeat_every
@router.on_event('startup')
@repeat_every(seconds=3)
async def print_hello():
print("hello")
- Cron Jobs: Easily trigger cron jobs on server startup using repeat_at by providing a cron expression.
from fastapi_utilities import repeat_at
@router.on_event("startup")
@repeat_at(cron="*/2 * * * *") #every 2nd minute
async def hey():
print("hey")
Requirements
This package is intended for use with any recent version of FastAPI and Python 3.7+.
Installation
pip install fastapi-utilities
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fastapi_utilities-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4e665be5ba7ce3f3954acdc925b2e42c1a36e2ee646aa37a5f75101a0b059a5 |
|
MD5 | e2a538673365fa166c01deb675c1453d |
|
BLAKE2b-256 | 114c2be0ab46a4f7a1ed7310ec49ddc5840953157c8e119fec2365b3dc6844d0 |