Cache Pandas Dataframes to Disk
Easily cache Pandas Dataframes to disk using a simple interface.
Sample usage
from cache_df import CacheDF
import pandas as pd
cache = CacheDF(cache_dir='./caches')
# Caching a dataframe
df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]})
cache.cache(df, 'my_df')
# Checking if a dataframe is cached
df_is_cached = cache.is_cached('my_df')
# Reading a dataframe from cache
try:
df = cache.read('my_df')
df_selective_cols = cache.read('my_df', columns=['a']) # Read only a subset of columns
except FileNotFoundError:
print('Dataframe not cached')
# Deleting a dataframe from cache if it exists
cache.uncache('my_df')
# Clearing all cached dataframes
cache.clear()
Where it can be used
- It can be used when you are using a shared file system across multiple machines such as AWS EFS, GCP Filestore, Azure Files, etc.
Metadata
Release files for cache-df 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cache_df-1.1.tar.gz | 2.9 kB | Without provenance | Details for cache_df-1.1.tar.gz |
Release files / cache_df-1.1.tar.gz
| Download URL | cache_df-1.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2925bfa5b4258eac306dc51e9bb77a869b6a64d7935ad3717d0754d96bcf4af
|
|
BLAKE2b-256 checksum How to use checksums |
1add3cd0b92d7950a7bf323ce622c30b3ea75a77a2cf2baf292aeaa0a9951e3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for cache-df 1.1
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.