Skip to main content
cultivars-data banner

The data layer for cultivars: the clients that bring public economic and financial series into a workflow, under one import, published as a distribution of its own.

Distribution PyPI Python Versions
Quality Ruff Checked with mypy
Packaging uv Hatch project
License License: MIT
Parent project cultivars on PyPI DOI

What it is

The models in cultivars take arrays. The series behind those arrays come from a small number of public providers, each served by a client library with its own repository, documentation and release cycle. cultivars-data (import name cultivars_data) is where those clients meet. It re-exports them under names that say what kind of data they carry, starting with economic, and it is where a provider-neutral way to fetch an aligned panel will be built.

Name Client Provider State
cultivars_data.economic fedfred FRED, ALFRED and the GeoFRED maps of the Federal Reserve Bank of St. Louis Available
cultivars_data.financial edgar-sec SEC EDGAR Name planned. The client is installed; import it as edgar_sec
Not named yet toros To be stated when the client has a release beyond its placeholder Name planned. The client is installed; import it as toros

Nothing here is estimated or transformed. A client returns observations; reducing them to the columns and the sample a question needs is the caller's step today and the connector's later.

What a re-export is, and is not

  • cultivars_data.economic is the fedfred module. It is the same object, not a wrapper. Every class and function on it is fedfred's, documented on fedfred's site and versioned by fedfred.
  • The name says the kind of data. It does not hide the provider. economic.FredAPI is a FRED client, and code that calls it is written against fedfred's API.
  • Provider-neutral access is the connector's job. One call that takes a mapping of names to series and returns an aligned panel is on the roadmap, and is not part of 0.0.1.

How it relates to cultivars

  1. cultivars requires it and does not import it. From cultivars 1.0.0a7, pip install cultivars installs this package. No model imports it, and there is no cultivars.data module: your code imports cultivars_data directly.
  2. The dependency runs one way. cultivars-data imports nothing from cultivars. What crosses the boundary is an array and a tuple of names, which is the input every cultivars model already accepts.
  3. The version numbers are independent. A release here does not imply a cultivars release.

In cultivars 1.0.0a6 and earlier, cultivars.data imported fedfred directly. 1.0.0a7 removes that module, so from cultivars.data import economic becomes from cultivars_data import economic.

Stability

Surface Guarantee
Names defined by this package None before 1.0.0. The package is in its 0.0.x series and any release may rename or remove a name. Changes are listed in the CHANGELOG.
The re-exported client modules Not this package's API. Each follows its own project's versioning. A breaking change in a client reaches you through the version of that client you have installed, whatever the version of cultivars-data.

Installation

Requires Python 3.12 or later.

pip install cultivars-data

With uv:

uv add cultivars-data

Installing the package installs all three clients: fedfred, edgar-sec and toros. fedfred 3.0.0 and toros 0.0.1 each require pandas and geopandas, and all three require httpx, tenacity, cachetools and asyncache. An install is therefore much larger than the package's own source, which is a few lines.

Credentials

The providers issue keys, and each client reads its own.

  • FRED. fedfred takes the key from the api_key argument, from economic.set_api_key(...), or from the FRED_API_KEY environment variable. economic.FredAPI() raises a RuntimeError that names all three when none is set. A free key is issued at https://fred.stlouisfed.org/docs/api/api_key.html.
  • This package never sees the key. It does not read, store or log credentials. Key handling is the client's.
  • Nothing touches the network at import. import cultivars_data imports the clients and makes no request. A request is made only when you call a client method.

A quick check

Without a key and without a network connection:

>>> from cultivars_data import economic
>>> economic.__name__
'fedfred'
>>> economic.FredAPI.__module__
'fedfred.clients'

With a key, fetch two series, keep the dates on which both are observed, and hand the array to a model. This needs a network connection, so it is not run as a test:

import pandas as pd

from cultivars_data import economic

api = economic.FredAPI()  # reads FRED_API_KEY
series = {"ip": ("INDPRO", "pch"), "ffr": ("FEDFUNDS", "lin")}
columns = {
    name: pd.to_numeric(
        api.get_series_observations(code, observation_start="1990-01-01", units=units)["value"],
        errors="coerce",
    )
    for name, (code, units) in series.items()
}
panel = pd.DataFrame(columns).dropna()
y, names = panel.to_numpy(), tuple(panel.columns)

With cultivars installed, y and names go straight into a model:

from cultivars.multivariate.reduced_form.vector_autoregression import VAR

result = VAR(y, order=4, names=names).fit()

The dictionary comprehension above is the step the connector will replace.

Using what you fetch

The data belongs to its provider, and the provider's terms govern what you may do with it. For FRED, read the FRED API Terms of Use before building on it: among other things they restrict storing, caching and archiving FRED content, and using the API to develop or train machine-learning systems. Some series carry a copyright notice of their own. Cite a series the way its provider asks.

This package does not interpret those terms for you and adds no permission of its own.

Documentation

This package has no documentation site yet. Until it does:

Where to report an issue

What you saw Where it goes
A wrong value, a failed request or confusing behavior from a client method such as FredAPI The client's tracker: fedfred issues
An import that fails, a missing or misnamed re-export, or anything about the connector cultivars-data issues
A wrong number, an error or confusing behavior from a model, result or test cultivars issues
A security vulnerability Privately, as described in SECURITY.md

If you are not sure, file it here. Issues are moved to the tracker where the fix belongs.

Development

git clone https://github.com/nikhilxsunder/cultivars-data.git
cd cultivars-data
uv sync --all-groups
uv run pre-commit install
uv run ruff check src && uv run ruff format --check src
uv run mypy src

CONTRIBUTING.md gives the design rules, the rules for tests that involve a provider, and what a change that touches cultivars or a client has to include.

Citation

cultivars-data is part of cultivars and is not cited separately. If cultivars contributes to published work, cite the concept DOI, which resolves to the latest release:

@software{sunder_cultivars,
  author  = {Sunder, Nikhil},
  title   = {cultivars: Research-grade time series econometrics for Python},
  year    = {2026},
  doi     = {10.5281/zenodo.23028870},
  url     = {https://github.com/nikhilxsunder/cultivars}
}

Cite the data as well, in the form its provider asks for.

License

MIT. See LICENSE. The license covers this package's code. It does not cover the data a client returns.

Metadata

Release files for cultivars-data 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cultivars-data 0.0.1
File Size Uploaded Provenance Actions
cultivars_data-0.0.1.tar.gz 123.4 kB Without provenance Details for cultivars_data-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cultivars-data 0.0.1
File Interpreter ABI Platform Actions
cultivars_data-0.0.1-py3-none-any.whl Python 3 none any Details for cultivars_data-0.0.1-py3-none-any.whl

Total release size: 134.2 kB

Release files / cultivars_data-0.0.1.tar.gz

Download URL cultivars_data-0.0.1.tar.gz
Size 123.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7b1a0dca4cca7db7d134754b1bac5800e825708be971d9f0423804d3360f2eda
BLAKE2b-256 checksum
How to use checksums
a5aa88b5c82cb19575556a8dd30f68113f99f06ae3eceae779752a8d3189b3be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cultivars_data-0.0.1-py3-none-any.whl

Download URL cultivars_data-0.0.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b724ccf53d49e099d74f0fb71de9bda6420ddd1eef071294b950e6104063f9d
BLAKE2b-256 checksum
How to use checksums
496a766d1d3f9a020cc5d4037236120c0de5e5640020a9dfe610518801acdfc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cultivars-data 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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