Skip to main content

Simple data catalog library for python

This project is a trivial attempt at offering basic catalog functionality for structured datasets stored in local or remote folders. The library uses universal_pathlib to access remote storage locations like S3, Google Cloud Storage, etc ... The library reads a config file called fsdata.ini which defines a list of collections, one per section. Each collection corresponds to a local or remote folder containing data files, homogeneous in format: parquet collections hold DataFrames (pandas or polars), json collections hold plain lists/dicts — declared per collection in the config (format = json; parquet is the default). Consumers pick the accessor for the shape they want (.pandas(), .polars(), .json()); the wrong accessor for the collection format raises. The library uses local caching to avoid fetching the same data multiple times.

Warning This project is for exploration only, the interface can change.

Configuration

The configuration file fsdata.ini has one section for each collection, with the section name for name and with a path key pointing to its location. The file is resolved in order: the FSDATA_CONFIG environment variable, then upward search from the current directory (a repo-local config), then the standard XDG config directory XDG_CONFIG_HOME (or ~/.config). The first match wins; configs never merge.

Each collection declares its format with a format key (parquet or json); parquet is the default when the key is omitted.

Values support strict ${VAR} environment-variable interpolation, so a committed repo-local config can declare the collection layout while the storage root stays in the environment (e.g. provisioned by direnv). Unset variables raise a clear error on access — never a silent literal path.

# fsdata.ini

[samples]
path = ${MY_LAKE}/samples

[datasets]
path = ${MY_LAKE}/datasets
format = parquet

[tickers]
path = ${MY_LAKE}/tickers
format = json

To assert that the active config defines the collections your code depends on, fail fast with fsdata.require("tickers", "datasets"), or from the shell:

python -m fsdata check            # validate all configured collections
python -m fsdata check tickers    # validate specific collections

Usage

To access a collection use the collection function, or — for collection names that are valid identifiers — plain attribute access on the module.

import fsdata

samples = fsdata.collection("samples")
samples = fsdata.samples                  # same thing

To list the configured collections

fsdata.collection_names()

To list items in a collection (item names are bare names, without extension)

samples.items()
samples.has("my-sample")

To load data, pick the accessor for the shape you want. Each accessor has a single concrete return type, and raises if the collection format does not match.

samples.pandas("my-sample")     # -> pandas.DataFrame   (parquet collections)
samples.polars("my-sample")     # -> polars.DataFrame   (parquet collections)

tickers = fsdata.tickers
tickers.json("DOW30")           # -> plain list or dict (json collections)

To save data use the save method — the object type must match the collection format: pandas/polars DataFrames go to parquet collections, plain lists and dicts go to json collections. Anything else raises.

samples.save("my-sample", df)          # DataFrame -> .parquet
tickers.save("DOW30", ["MMM", "AXP"])  # list -> .json

Deprecated APIs

The following functions still work but emit a DeprecationWarning; new code should use the replacements.

Deprecated Use instead
fsdata.collections() fsdata.collection_names()
fsdata.load(name, item, backend=...) fsdata.collection(name).pandas(item) / .polars(item) / .json(item)
Collection.load(item, backend=...) Collection.pandas(item) / .polars(item) / .json(item)

The backend= parameter is superseded by the accessor names: instead of selecting the return type with an argument, call the accessor that returns what you want.

Installation

You can install the package with pip

pip install fsdata

The frame backends are extras — install the one(s) matching the accessors you use: pandas, polars. Cloud storage backends are extras as well: s3, gcs, adl install the required fsspec backend.

pip install "fsdata[pandas,s3]"

Requirements

  • pandas and/or polars (each needed only by its own accessor — see extras)
  • pyarrow
  • universal_pathlib
  • fsspec backends like s3fs, etc ... as applicable (see extras)

Related Projects and Resources

  • intake - Lightweight package for finding, investigating, loading and disseminating data.
  • pins - Publish data sets, models, and other python objects, making it easy to share them across projects and with your colleagues.
  • quilt - Quilt is a data mesh for connecting people with actionable data
  • pystore - Fast data store for Pandas time-series data
  • pandas - Flexible and powerful data analysis / manipulation library for Python
  • pyarrow - Universal columnar format and multi-language toolbox
  • parquet - Apache Parquet Format
  • fsspec - Filesystem interfaces for Python
  • universal_pathlib - pathlib api extended to use fsspec backends

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fsdata-0.0.8-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file fsdata-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: fsdata-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.04","id":"plucky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fsdata-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8284d67c33f80b247617e8da33129e48254170443af3266a19285ee8e784e53a
MD5 fecfd2b188a669fd73e5265d76c67ea2
BLAKE2b-256 514f07b4c664ed8ec726554a4b87d4e5296f074c0e75441f88b1d0a3249225ec

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.9

1 file

This release

0.0.8 This release

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

0.0.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page