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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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