Simple stats for fastapi api
Project description
Api-Stats
Updates a json file with the function name whenever the function is called
I'm gonna use this with my api so im calling it api-stats
Download:
pip install fast-api-stats
Example Usage:
from fastapi import FastAPI
from fastapistats import Stats
app = FastAPI()
# Add this line if you want a custom location for you json file
Stats.file_name = "json_files/stats.json"
# you can also make a variable with the class and use that instead of @Stats.update_stats
update = Stats.update_stats
@app.get("/name")
@update(name="name") # if the name kwarg is not passed it will default to the function name
def show_name(name : str): # This is just an example endpoint
return {"your_name" : name}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for fast_api_stats-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 274df88df51c344a7830c1187030f53adfeba2395ccb1e1c32342ddfa630d498 |
|
MD5 | fced4a15217cd083565e0483df35b3e0 |
|
BLAKE2b-256 | ee340a2ff07544eabe98f17a722a361edfbcce4819eb4b85d0a37fc999ec1147 |