pystow
Easily pick a place to store data for your Python code
What it is and what it does
PyStow abstracts away the decision of where to store application data by providing a consistent interface for managing directories and files in a user's home directory (typically ~/.data). It handles directory creation automatically and provides convenience methods to download, cache, and load remote files in various formats.
The package is designed for Python applications that need to persist data between runs—such as downloaded datasets, cached API responses, or application state. It supports optional integration with XDG Base Directory specifications and allows configuration via environment variables (PYSTOW_HOME, PYSTOW_NAME, PYSTOW_USE_APPDIRS). Optional dependencies enable loading data as pandas DataFrames, RDF graphs, or other structured formats.
Use it for:
- Store and retrieve cached datasets for machine learning or data analysis workflows
- Download and manage remote files (CSV, RDF, archives) with automatic caching to avoid re-downloading
- Provide a consistent data directory for Python applications that need persistent storage across sessions
- Organize application-specific configuration and state files in a standard location
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyStow provides a standardized way to store and retrieve application data files in a user's home directory, with built-in support for downloading and caching remote files.
Yes. PyStow solves a common problem with minimal dependencies and active maintenance. It is well-suited for any Python application needing straightforward data persistence and file caching. The MIT license and zero known vulnerabilities make it a low-risk addition. Install it if your application downloads or caches files, or needs a standard place to store application data.
Install
pystow on PyPI
pip
pip install pystowuv
uv add pystowpoetry
poetry add pystowInstalling pystow
Before you install
Low install friction with only three runtime dependencies (tqdm, typing-extensions, backports-zstd). Active maintenance with a release 4 days ago and ongoing repository activity.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed-source projects.
Quickstart
import pystow
# Get a directory for your app
app_dir = pystow.join("myapp")
# Download and cache a file
url = "https://example.com/data.txt"
path = pystow.ensure("myapp", "data", url=url)
Verify before relying
- Whether ensure_csv, ensure_rdf, ensure_excel and other format-specific methods work without optional dependencies installed
- Performance characteristics when managing large numbers of cached files or deep directory hierarchies
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — tqdm, typing-extensions, backports-zstd |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 392,830/month — #7,004 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pystow-0.9.0-py3-none-any.whl
Keywords: snekpack, cookiecutter, caching, file management
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
appdirsDetermines the correct platform-specific…
permissive · top 1,000 on PyPI
platformdirsDetermines platform-specific directories for…
permissive · top 100 on PyPI
xdg-base-dirsProvides functions to retrieve XDG Base…
permissive · top 15,000 on PyPI
pickleyInstalls and auto-upgrades standalone Python…
permissive · top 15,000 on PyPI
types-appdirsProvides type stubs for the appdirs package to…
permissive · top 15,000 on PyPI
flexcacheCaches the results of expensive computations to…
permissive · top 5,000 on PyPI
aws-secretsmanager-cachingCaches AWS Secrets Manager secrets in-process…
permissive · top 5,000 on PyPI
pytest-cacheA pytest plugin that persists test state across…
permissive · top 15,000 on PyPI
pytest-regressionsProvides pytest fixtures for writing regression…
permissive · top 5,000 on PyPI