Skip to main content

Cacheia Decorators

Exposes decorators that can be used along FastAPI and plain functions to cache responses using cacheia machinery.

Installation

Install decorators with "schemas" optional and "local" and "remote" cache support:

pip install -e ./decorators[schemas,local,remote]

Code

There are these decorators avaialble:

  • local.cache: which can be used on plain functions to cache values using a local cache or cacheia_client.
  • remote.cache: which can be used to cache values on a remote instance of cacheia (i.e. cacheia_api service).

Usage

from cacheia_decorators.local import cache as local_cache
from cacheia_decorators.remote import cache as remote_cache


@local_cache(key_builder=lambda i: str(i == 0), settings={})
def function_a():
    return "Hello World"

@remote_cache(key_builder=lambda i: str(i == 0), url="http://localhost:5000/")
def function_b():
    return "Hello World"

Metadata

Release files for cacheia-decorators 1.0.0.post3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cacheia-decorators 1.0.0.post3
File Size Uploaded Provenance Actions
cacheia_decorators-1.0.0.post3.tar.gz 2.5 kB Without provenance Details for cacheia_decorators-1.0.0.post3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cacheia-decorators 1.0.0.post3
File Interpreter ABI Platform Actions
cacheia_decorators-1.0.0.post3-py3-none-any.whl Python 3 none any Details for cacheia_decorators-1.0.0.post3-py3-none-any.whl

Total release size: 5.7 kB

Release files / cacheia_decorators-1.0.0.post3.tar.gz

Download URL cacheia_decorators-1.0.0.post3.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4a7472bfde6062474605cacdaa94e282b9054e65105e2121b9dffdc070a52ee6
BLAKE2b-256 checksum
How to use checksums
cae65a5799c62dbc6eebcd9dd57f4bfe535fb9dee3bd45ac0640a2b7bbca34d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / cacheia_decorators-1.0.0.post3-py3-none-any.whl

Download URL cacheia_decorators-1.0.0.post3-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7503b4c10c494026bf4190edd95c1b6a740dd125f62f23e9f52030e4cd8fcfd1
BLAKE2b-256 checksum
How to use checksums
60d4b5a6fc94e19164a1f8f3c2ed62c06db5d31c9e3afbda7533148ec0bb52ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for cacheia-decorators 1.0.0.post3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0.post3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page