skillfed

pystow

Easily pick a place to store data for your Python code

pystow v0.9.0 392.8K downloads/30d#7,004 on PyPI43
Permissive license MIT Active released

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 pystow

uv

uv add pystow

poetry

poetry add pystow

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: PytestFramework :: SphinxFramework :: toxIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

application data directory managementfile caching and downloadhome directory data storagepersistent app configuration storageremote file ensure and cache
file-cachingdata-persistence

More Software Development packages