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.1.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.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfilecache-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7e86e76b80733166259a22de8f3b7386732dd1eba59b4cbe4e729bd52159a334
MD5 ffb60b8a370414604df10edaa69a0b16
BLAKE2b-256 8e9a425c1e97c3444412d98c12394c1a8491d3c399809d80fe89e0736af7a4d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfilecache-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7db907365d29ea586ff4918375fad81aee14ae336d1179a2e2d1c42668f25a59
MD5 ad608d2311504cd13caf751a1e500f0a
BLAKE2b-256 8254f89d3dbdd8f4d0c25f85473c292223128a94074cef3f40b484974c040035

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