{"id":15969843,"url":"https://github.com/thombashi/df-diskcache","last_synced_at":"2025-10-11T05:45:49.378Z","repository":{"id":209294335,"uuid":"723659163","full_name":"thombashi/df-diskcache","owner":"thombashi","description":"df-diskcache is a Python library for caching pandas.DataFrame objects to local disk.","archived":false,"fork":false,"pushed_at":"2023-12-11T14:35:29.000Z","size":21,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-27T16:29:06.123Z","etag":null,"topics":["disk-cache","pandas-dataframe","python-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thombashi.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-26T11:30:01.000Z","updated_at":"2024-11-09T10:24:03.000Z","dependencies_parsed_at":"2024-01-15T21:50:20.150Z","dependency_job_id":null,"html_url":"https://github.com/thombashi/df-diskcache","commit_stats":null,"previous_names":["thombashi/df-diskcache"],"tags_count":2,"template":false,"template_full_name":"thombashi/python-lib-project-template","purl":"pkg:github/thombashi/df-diskcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fdf-diskcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fdf-diskcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fdf-diskcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fdf-diskcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thombashi","download_url":"https://codeload.github.com/thombashi/df-diskcache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thombashi%2Fdf-diskcache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006354,"owners_count":26084087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disk-cache","pandas-dataframe","python-library"],"created_at":"2024-10-07T19:41:54.020Z","updated_at":"2025-10-11T05:45:49.345Z","avatar_url":"https://github.com/thombashi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. contents:: **df-diskcache**\n   :backlinks: top\n   :depth: 2\n\n\nSummary\n============================================\n\n``df-diskcache`` is a Python library for caching ``pandas.DataFrame`` objects to local disk.\n\n.. image:: https://badge.fury.io/py/df-diskcache.svg\n    :target: https://badge.fury.io/py/df-diskcache\n    :alt: PyPI package version\n\n.. image:: https://img.shields.io/pypi/pyversions/df-diskcache.svg\n    :target: https://pypi.org/project/df-diskcache\n    :alt: Supported Python versions\n\n.. image:: https://github.com/thombashi/df-diskcache/actions/workflows/ci.yml/badge.svg\n    :target: https://github.com/thombashi/df-diskcache/actions/workflows/ci.yml\n    :alt: CI status of Linux/macOS/Windows\n\n.. image:: https://coveralls.io/repos/github/thombashi/df-diskcache/badge.svg?branch=master\n    :target: https://coveralls.io/github/thombashi/df-diskcache?branch=master\n    :alt: Test coverage: coveralls\n\n.. image:: https://github.com/thombashi/df-diskcache/actions/workflows/github-code-scanning/codeql/badge.svg\n    :target: https://github.com/thombashi/df-diskcache/actions/workflows/github-code-scanning/codeql\n    :alt: CodeQL\n\n\nInstallation\n============================================\n::\n\n    pip install df-diskcache\n\n\nFeatures\n============================================\n\nSupports the following methods:\n\n- ``get``: Get a cache entry (``pandas.DataFrame``) for the key. Returns ``None`` if the key is not found.\n- ``set``: Create a cache entry with an optional time-to-live (TTL) for the key-value pair.\n- ``update``\n- ``touch``: Update the last accessed time of a cache entry to extend the TTL.\n- ``delete``\n- ``prune``: Delete expired cache entries.\n- Dictionary-like operations:\n    - ``__getitem__``\n    - ``__setitem__``\n    - ``__contains__``\n    - ``__delitem__``\n\n\nUsage\n============================================\n\n:Sample Code:\n    .. code-block:: python\n\n        import pandas as pd\n        from dfdiskcache import DataFrameDiskCache\n\n        cache = DataFrameDiskCache()\n        url = \"https://raw.githubusercontent.com/pandas-dev/pandas/v2.1.3/pandas/tests/io/data/csv/iris.csv\"\n\n        df = cache.get(url)\n        if df is None:\n            print(\"cache miss\")\n            df = pd.read_csv(url)\n            cache.set(url, df)\n        else:\n            print(\"cache hit\")\n\n        print(df)\n\nYou can also use operations like a dictionary:\n\n:Sample Code:\n    .. code-block:: python\n\n        import pandas as pd\n        from dfdiskcache import DataFrameDiskCache\n\n        cache = DataFrameDiskCache()\n        url = \"https://raw.githubusercontent.com/pandas-dev/pandas/v2.1.3/pandas/tests/io/data/csv/iris.csv\"\n\n        df = cache[url]\n        if df is None:\n            print(\"cache miss\")\n            df = pd.read_csv(url)\n            cache[url] = df\n        else:\n            print(\"cache hit\")\n\n        print(df)\n\n\nSet TTL for cache entries\n--------------------------------------------\n\n:Sample Code:\n    .. code-block:: python\n\n        import pandas as pd\n        from dfdiskcache import DataFrameDiskCache\n\n        DataFrameDiskCache.DEFAULT_TTL = 10  # you can override the default TTL (default: 3600 seconds)\n\n        cache = DataFrameDiskCache()\n        url = \"https://raw.githubusercontent.com/pandas-dev/pandas/v2.1.3/pandas/tests/io/data/csv/iris.csv\"\n\n        df = cache.get(url)\n        if df is None:\n            df = pd.read_csv(url)\n            cache.set(url, df, ttl=60)  # you can set a TTL for the key-value pair\n\n        print(df)\n\n\nDependencies\n============================================\n- Python 3.7+\n- `Python package dependencies (automatically installed) \u003chttps://github.com/thombashi/df-diskcache/network/dependencies\u003e`__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthombashi%2Fdf-diskcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthombashi%2Fdf-diskcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthombashi%2Fdf-diskcache/lists"}