Install & Compatibility
Where this runs
tested against v0.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.972s · 58MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.6s · import 1.780s · 55MB
56MB installed
● package 56MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
repeat_every
✓ from fastapi_utilities import repeat_every
✗ from fastapi_utilities.repeat import repeat_every
repeat_every is exposed at package level; do not use submodule path.
repeat_at
✓ from fastapi_utilities import repeat_at
Added in 0.2.0.
on_startup
✓ from fastapi_utilities import on_startup
Simple decorator; do not use app.add_event_handler with this.
Minimal example: on_startup and repeat_every decorator.
from fastapi import FastAPI
from fastapi_utilities import repeat_every, on_startup
app = FastAPI()
@on_startup
async def startup():
print("App started")
@app.on_event("startup")
@repeat_every(seconds=30)
async def periodic_task():
print("Task executed")
Errors
Common errors & fixes
AttributeError: module 'fastapi_utilities' has no attribute 'repeat_every'
Old import path used, or package not installed correctly.
fixRun `pip install --upgrade fastapi-utilities` and use `from fastapi_utilities import repeat_every`.
ImportError: cannot import name 'repeat_on_startup' from 'fastapi_utilities'
Incorrect function name (does not exist).
fixUse `from fastapi_utilities import on_startup`.
TypeError: 'NoneType' object is not callable
Decorator order reversed: `@repeat_every` placed above `@app.on_event`.
fixEnsure `@app.on_event('startup')` is the outermost decorator. Upgrade
Version history
0.3.1latest on PyPI · released Mar 25, 2025
Audit
Dependencies
No dependency data recorded yet.