Skip to main content

A full featured API client for the FRED API web service.

Project description

pyfredapi - Python library for the Federal Reserve Economic Data (FRED) API

CI/CD CI - Test
Docs Documentation Status
Package PyPi Version Supported Python Versions PyPI - Downloads
Meta Hatch project linting - Ruff code style - Black types - Mypy License - MIT Quality Gate Status Security Rating Reliability Rating

pyfredapi is a full featured Python library that makes it is easy to retrieve data from the Federal Reserve Economic Data (FRED) API web service. pyfredapi covers all the FRED api endpoints, and can retrieve data from FRED and ALFRED. Data can be returned as a pandas dataframe or json. Requests to the FRED API can be customized according to the parameters made available by the web service endpoints.

Documentation

The documentation is made with Sphinx and hosted on Read the Docs.

Installation

pip install pyfredapi

# install with plotting dependencies
pip install 'pyfredapi[plot]'

Quick Start

FRED API Key

Before using pyfredapi and must have an API key to the FRED API web service. You can apply for one for free on the FRED website.

You can set your API key in two ways:

  • set your API key to the environment variable FRED_API_KEY
  • pass it to the api_key parameter of the request function

You can set the API key as an environment variable by adding the following line to your ~/.zshrc, ~/.bashrc file:

export FRED_API_KEY="your_api_key"

Using pyfredapi

Each of the FRED API endpoint namespaces is covered by a module in pyfredapi. For a deeper dive into each of the modules see the tutorials and API reference in the documentation.

  • category - covers the FRED Categories endpoints
  • maps - covers the FRED Maps endpoints
  • release - covers the FRED Releases endpoints
  • series - covers the FRED Series endpoints
  • sources - covers the FRED Sources endpoints
  • tags - covers the FRED Tags endpoints
  • series_collection - makes handling multiple series easier

Quick start example:

import pyfredapi as pf

# api key set as environment variable
pf.get_series(series_id="GDP")

# api key passed to the function
pf.get_series(series_id="GDP", api_key="my_api_key")

Contributing

Thank you for your interest in contributing to pyfredapi. Check out the contributing guide to get started.

Project details


Download files

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

Source Distribution

pyfredapi-0.8.0.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

pyfredapi-0.8.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file pyfredapi-0.8.0.tar.gz.

File metadata

  • Download URL: pyfredapi-0.8.0.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pyfredapi-0.8.0.tar.gz
Algorithm Hash digest
SHA256 7bbba748571ba084fd7cb4a2d7303b0fc2029d6420ae08de261631ede003b37e
MD5 1e8bb6834ccd6b62233d0000b9216f83
BLAKE2b-256 e3a9971088be6239337404f88940686b83ae184b63c28dc0c48bc105a34a4978

See more details on using hashes here.

Provenance

File details

Details for the file pyfredapi-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: pyfredapi-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pyfredapi-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85ad7acd8e8543ec7a9a038138ff6d5b7e2d7fc0d5243805eeedaab21ae4efed
MD5 b695f543cd4bd95881e6929b31e80c82
BLAKE2b-256 01a64707d5c72b9e519da2e08d5686ec45e4deb5d2cdcca504ccba018c004fb7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page