Skip to main content

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 parameter instance: CachedValue and creates a new cache instance in the configured backend.
  • GET /cache/: receives the optional params group: 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 params key: str and gets the cached value for the given key.
  • DELETE /cache/: receives the optional params group: 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 param key: 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:

  • Iterative: for an iterative experience
  • Redoc: for a more detailed view

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cacheia_api-1.0.0.post3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cacheia_api-1.0.0.post3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

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

Hashes for cacheia_api-1.0.0.post3.tar.gz
Algorithm Hash digest
SHA256 1b98c18f3094355e9fdb9e15f47442e6abd6eda3bc2fe804e2c6c23453ceaf10
MD5 c76240c1f422fddea58f3fda72d8fa17
BLAKE2b-256 d27f4e4b4fff2259de088a978c93a7f8f1251694c97093e19e99e124ccac2e58

See more details on using hashes here.

File details

Details for the file cacheia_api-1.0.0.post3-py3-none-any.whl.

File metadata

File hashes

Hashes for cacheia_api-1.0.0.post3-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2e9ac171c642e467dbd7727c7a06183d7cf5d4024c7de3a32e0a9c2c98f5f7
MD5 773bcc61361817e4b68312a81344812a
BLAKE2b-256 2bdef2c001c1eda76577eb4342caae7adc4768c6a64b542652b9ed72124c4332

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page