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: CachedValueand 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: strand 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: strand 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cacheia_api-1.0.0.post3.tar.gz.
File metadata
- Download URL: cacheia_api-1.0.0.post3.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b98c18f3094355e9fdb9e15f47442e6abd6eda3bc2fe804e2c6c23453ceaf10
|
|
| MD5 |
c76240c1f422fddea58f3fda72d8fa17
|
|
| BLAKE2b-256 |
d27f4e4b4fff2259de088a978c93a7f8f1251694c97093e19e99e124ccac2e58
|
File details
Details for the file cacheia_api-1.0.0.post3-py3-none-any.whl.
File metadata
- Download URL: cacheia_api-1.0.0.post3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a2e9ac171c642e467dbd7727c7a06183d7cf5d4024c7de3a32e0a9c2c98f5f7
|
|
| MD5 |
773bcc61361817e4b68312a81344812a
|
|
| BLAKE2b-256 |
2bdef2c001c1eda76577eb4342caae7adc4768c6a64b542652b9ed72124c4332
|