Skip to main content

Cloud Cache

Cloud Cache is a Python package for caching data and files in Google Cloud Storage.

Features

  • Store and retrieve cached results from Google Cloud Storage
  • Supports JSON and file-based caching
  • Easy-to-use decorator for function caching
  • Ensures the Cloud Storage bucket exists before usage

Installation

pip install gcloud_cache

Installing locally:

python setup.py clean --all
python setup.py sdist bdist_wheel
twine upload dist/*

Usage

Basic Caching Example

from cloud_cache import cache_result

@cache_result
def expensive_function(param):
    return {"result": f"Processed {param}"}

print(expensive_function("test"))  # First call - runs the function
print(expensive_function("test"))  # Second call - retrieves from cache

Configuration

Cloud Cache requires a configuration file cloud_storage.yaml, which should be placed in the local/ directory.

Example local/cloud_storage.yaml:

bucket_name: your-cache-bucket
credentials_path: local/pdf-converter-449809-b8ce9144eafa.json
  • bucket_name - The name of the Google Cloud Storage bucket.
  • credentials_path - The path to the service account JSON file for authentication.

Ensure that local/cloud_storage.yaml is not committed to your repository by adding local/cloud_storage.yaml to your .gitignore file.

License

MIT License

Metadata

Release files for gcloud-cache 0.1.7

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

Source distribution (sdist)

Source distribution for gcloud-cache 0.1.7
File Size Uploaded
gcloud_cache-0.1.7.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gcloud-cache 0.1.7
File Interpreter ABI Platform
gcloud_cache-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / gcloud_cache-0.1.7.tar.gz

Download URL gcloud_cache-0.1.7.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
75a3c0ace80b94672f174d963520837559f5659c3beec3707877a0d1d3e8c68c
BLAKE2b-256 checksum
How to use checksums
34bce1519d017fa42a58a51986911e3288d16d1ce7de34cefa2a7df0f0e6dd32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release files / gcloud_cache-0.1.7-py3-none-any.whl

Download URL gcloud_cache-0.1.7-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae67d6281047c5352ac08fabd5a36e485b0000dee6cfb6f5d382e6599369a623
BLAKE2b-256 checksum
How to use checksums
5a69c3f937e64570faf8de1a0763d69d354119d14bd6cc5d9b7b5b35c1b6abaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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