Skip to main content

fred-stl

A Python library for the FRED API (Federal Reserve Economic Data, St. Louis Fed).

Installation

pip install fred-stl

Requirements

Quick start

import json
import urllib.parse
import urllib.request

from fred import category, for_request

params = category.RequestParams(
    api_key="your-api-key",
    file_type=category.FileType.json,
    category_id=0,
)

url = f"{category.ENDPOINT}?{urllib.parse.urlencode(for_request(params))}"

with urllib.request.urlopen(url) as resp:
    data = json.loads(resp.read())

response = category.Response.model_validate(data)
print(response.categories[0].name)  # "Categories"

Usage

Each FRED endpoint is exposed as a module at the top level of the fred package. Every module provides:

  • RequestParams — a typed, validated model for building requests
  • Response — a typed, validated model for parsing responses
  • ENDPOINT — the API endpoint URL
  • Any enum types needed to construct a request (e.g. FileType, SortOrder)

Use for_request to convert a RequestParams instance into a dict[str, str] ready for any HTTP client:

from fred import for_request, releases

params = releases.RequestParams(
    api_key="your-api-key",
    file_type=releases.FileType.json,
)

query = for_request(params)  # {"api_key": "...", "file_type": "json", ...}

Available endpoints

Category

Module Endpoint
category fred/category
category_children fred/category/children
category_related fred/category/related
category_series fred/category/series
category_tags fred/category/tags
category_related_tags fred/category/related_tags

Releases

Module Endpoint
releases fred/releases
releases_dates fred/releases/dates
release fred/release
release_dates fred/release/dates
release_series fred/release/series
release_sources fred/release/sources
release_tags fred/release/tags
release_related_tags fred/release/related_tags
release_tables fred/release/tables

Series

Module Endpoint
series fred/series
series_categories fred/series/categories
series_observations fred/series/observations
series_release fred/series/release
series_search fred/series/search
series_search_tags fred/series/search/tags
series_search_related_tags fred/series/search/related_tags
series_tags fred/series/tags
series_updates fred/series/updates
series_vintagedates fred/series/vintagedates

Sources

Module Endpoint
sources fred/sources
source fred/source
source_releases fred/source/releases

Tags

Module Endpoint
tags fred/tags
tags_related fred/related_tags
tags_series fred/tags/series

Maps (GeoFRED)

Module Endpoint
geofred_shapes geofred/shapes/file
geofred_series_group geofred/series/group
geofred_series_data geofred/series/data
geofred_regional_data geofred/regional/data

Contributing

See CONTRIBUTING.md.

Metadata

Release files for fred-stl 0.9.16

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

Source distribution (sdist)

Source distribution for fred-stl 0.9.16
File Size Uploaded Provenance Actions
fred_stl-0.9.16.tar.gz 15.9 kB Without provenance Details for fred_stl-0.9.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fred-stl 0.9.16
File Interpreter ABI Platform Actions
fred_stl-0.9.16-py3-none-any.whl Python 3 none any Details for fred_stl-0.9.16-py3-none-any.whl

Total release size: 88.2 kB

Release files / fred_stl-0.9.16.tar.gz

Download URL fred_stl-0.9.16.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d0973200aaaeb3ca10a87bd5dbc243734e159aef34e518b92fad78065d19fe2b
BLAKE2b-256 checksum
How to use checksums
519a7eed733178151c71ca420f31a1e2f5d1f43743f39aade8f4d95db7e5d540
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fred_stl-0.9.16-py3-none-any.whl

Download URL fred_stl-0.9.16-py3-none-any.whl
Size 72.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89493db0c2c2bd12bad177032f45ee15bfc839d8b5aab77b6f032bfef97c9670
BLAKE2b-256 checksum
How to use checksums
48eb4128a4f038b4291b8fa082421d7dad3fb6336ce1b29e562bf51be5a240d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fred-stl 0.9.16

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.

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