cached-path
A file utility for accessing both local and remote files through a unified interface
Decision gist · record as of 2026-08-14
Yes. The package solves a real problem in ML/data workflows—unifying file access across local and cloud storage—with low install friction, active maintenance, no known vulnerabilities, and permissive licensing. It's a thin, focused utility that does one thing well and integrates cleanly with common cloud providers and model hubs.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later
- Low install friction with a pure Python wheel.
- Depends on requests, rich, filelock, boto3, google-cloud-storage, huggingface-hub, and packaging.
License · maintenance · safety
permissive license (permissive) — Licensed under Apache 2.0 (permissive), allowing commercial and derivative use with minimal restrictions—just retain license notices and disclose modifications.
last release 2026-03-20 (147 days) · last repo commit 2026-04-27 · 47 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 554,689 downloads/mo, #6,032 on PyPI
Alternatives
Verify before relying
pip install cached-path
from cached_path import cached_path
# Download and cache a remote file
local_path = cached_path("https://example.com/model.bin")
# Or access a HuggingFace Hub file
local_path = cached_path("hf://epwalsh/bert-xsmall-dummy/pytorch_model.bin")
# Extract a file from a remote archive
local_path = cached_path("model.tar.gz!weights.th", extract_archive=True)- Whether beaker:// URL support requires optional beaker-py installation or is enabled by default
- Performance characteristics when caching large files or handling concurrent access via filelock
What it is and what it does
cached-path is a file utility that abstracts away the difference between local paths and remote URLs, letting you treat them uniformly. Pass it a local path, HTTP URL, S3 URI, Google Cloud Storage path, or HuggingFace Hub reference—it checks if the file exists locally, downloads and caches it if remote, and returns the local path. It also supports extracting specific files from tar and zip archives on the fly.
The package is built for AI/ML workflows where models and datasets live in different places (local disk, cloud storage, model hubs) and you want a single code path to handle all of them. It handles authentication via custom headers, manages a configurable cache directory (defaulting to ~/.cache/cached_path/), and uses filelock to coordinate concurrent access.
Use it for
- Download and cache model weights from HuggingFace Hub in a single call without manual path logic.
- Build data pipelines that work with datasets stored on S3, Google Cloud Storage, or local disk using identical code.
- Extract a specific file from a remote tarball or zipfile and cache it locally without manual archive handling.
- Authenticate to private repositories using bearer tokens and cache the downloaded files automatically.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package solves a real problem in ML/data workflows—unifying file access across local and cloud storage—with low install friction, active maintenance, no known vulnerabilities, and permissive licensing. It's a thin, focused utility that does one thing well and integrates cleanly with common cloud providers and model hubs.
Install
cached-path on PyPI
Before you install
Low install friction with a pure Python wheel. Depends on requests, rich, filelock, boto3, google-cloud-storage, huggingface-hub, and packaging. Actively maintained with recent commits and no archived status.
Requires Python 3.9 or later
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial and derivative use with minimal restrictions—just retain license notices and disclose modifications.
Quickstart
pip install cached-path
from cached_path import cached_path
# Download and cache a remote file
local_path = cached_path("https://example.com/model.bin")
# Or access a HuggingFace Hub file
local_path = cached_path("hf://epwalsh/bert-xsmall-dummy/pytorch_model.bin")
# Extract a file from a remote archive
local_path = cached_path("model.tar.gz!weights.th", extract_archive=True)
Verify before relying
- Whether beaker:// URL support requires optional beaker-py installation or is enabled by default
- Performance characteristics when caching large files or handling concurrent access via filelock
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagesrequestsrichfilelockboto3google-cloud-storagehuggingface-hubpackaging |
| Maintenance | Actively maintained 147 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 554,689 / month, #6,032 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: cached_path-1.8.10-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “unified file access local and remote”
- cached-pathProvides a unified interface to access local and remote files (HTTP,…
- fsspecfsspec provides a unified filesystem interface specification and…
- blobfileProvides a unified Python file interface for reading and writing to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also truss-transfer · huggingface · hf-transfer · requests-cache · hf · cloudpathlib · datasets · universal-pathlib