Skip to main content

Cache pandas dataframes with a simple interface

Project description

Cache Pandas Dataframe to Disk

Easily cache Pandas Dataframes to disk using a simple interface.

Sample usage

import CacheDF
import pandas as pd

cache_df = CacheDF(cache_dir='./caches')

# Caching a dataframe
df = pd.DataFrame(...)
cache_df.cache(df, 'my_df')

# Checking if a dataframe is cached
df_is_cached = cache_df.is_cached('my_df')

# Reading a dataframe from cache
try:
    df = cache_df.read('my_df')
except FileNotFoundError:
    print('Dataframe not cached')

# Deleting a dataframe from cache if it exists
cache_df.uncache('my_df')

# Clearing all cached dataframes
cache_df.clear()

Where it can be used

  1. It can be used when you are using a shared file system across multiple machines such as AWS EFS, GCP Filestore, Azure Files, etc.

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

cache_df-0.4.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file cache_df-0.4.tar.gz.

File metadata

  • Download URL: cache_df-0.4.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for cache_df-0.4.tar.gz
Algorithm Hash digest
SHA256 1cdef514627724a9f109a7e2c73dbe34a3873721c2ef485498de60378df6fd44
MD5 6f3a198bc1742e330dd11c5d9ee95215
BLAKE2b-256 3f29a7af280f68dd04145d028752b30dc2c8f9dcc6df8b2f1287f5781b0df4ce

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