Skip to main content

cache results of slow function to disk

Project description

pyfilecache

import pandas as pd
from functools import partial
from pyfilecache import file_cache

df_cache = partial(file_cache, reader=pd.read_csv, writer=pd.DataFrame.to_csv)

@df_cache
def func(a, b):
    print(a, b)
    return pd.DataFrame(
        data = {
            'col1': [1, 2],
            'col2': [a, b]
        }
    )

print(func(3, 4))

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

pyfilecache-0.1.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfilecache-0.1.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file pyfilecache-0.1.0.tar.gz.

File metadata

  • Download URL: pyfilecache-0.1.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for pyfilecache-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b7c64d3819d8e499f6ff495f567856919a90354fa7ee0176ab626e0b9a873da
MD5 0dfabf0b5d0dedfadde9252d93affcd9
BLAKE2b-256 b9d19a3a580a3929623fbf838fa9d0cc2e3c49855539906b79c3c35a9ce89c0c

See more details on using hashes here.

File details

Details for the file pyfilecache-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyfilecache-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for pyfilecache-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54d3b9ebb6ba4b8b18e84f5ffb88d4c937114a311211234bd084424d5dda6313
MD5 1d9b058ac153d5ad5dc25f11c6a122ed
BLAKE2b-256 581a1ff53621d171af5e38546f96a24c634918bbd4efbdb591296b0c3d91700a

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