Git Product home page Git Product logo

pyfredapi's Introduction

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

CI/CD CI - Test
Docs Documentation Status
Package PyPi Version Supported Python Versions
Meta Hatch project linting - Ruff code style - Black types - Mypy License - MIT 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.

pyfredapi's People

Contributors

gw-moore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.