FastAPI based API for cache service that allows invalidation and other shenanigans
Project description
Cacheia API
This module contains the API for the Cacheia project. It exposes a HTTP interface to interact with all cacheia functionalities.
Installation
Install core with "core" optional to download core dependency:
pip install -e ./api[core]
API Endpoints
- POST
/cache/
: receives the body parameterinstance: CachedValue
and creates a new cache instance in the configured backend. - GET
/cache/
: receives the optional paramsgroup: str, expires_range: tuple[float, float], creation_range: tuple[datetime, datetime]
and gets all cached values that match the filters. - GET
/cache/{key}/
: receives the paramskey: str
and gets the cached value for the given key. - DELETE
/cache/
: receives the optional paramsgroup: str, expires_range: tuple[float, float], creation_range: tuple[datetime, datetime]
and flushes all cached values that matched the criteria. - DELETE
/cache/{key}/
: receives the paramkey: str
and flushes a specific key, removing its register in application cache. - DELETE
/cache/$clear/
: receives no params and flushes all cached values in the application cache.
Docs
Run the code locally and check-out:
Running the API
To run the API it is only necessary to install the cacheia_api
(api folder) and cacheia
(core folder) packages and run the command:
python -m cacheia_api
It will run a local server with reload and one worker configured by default.
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 cacheia_api-1.0.0.post3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a2e9ac171c642e467dbd7727c7a06183d7cf5d4024c7de3a32e0a9c2c98f5f7 |
|
MD5 | 773bcc61361817e4b68312a81344812a |
|
BLAKE2b-256 | 2bdef2c001c1eda76577eb4342caae7adc4768c6a64b542652b9ed72124c4332 |