Coder Social home page Coder Social logo

jmetrics86 / lazy_fred Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 5.06 MB

A wrapper for the fredapi package to pull in the most popular timeseries across daily, weekly and monthly granularities. Great for storing economic data for modeling and analysis!

Home Page: https://pypi.org/project/lazy_fred/

License: MIT License

Python 100.00%
economic economic-data economics-models fredapi macroeconomics us

lazy_fred's Introduction

lazy_fred_social

example workflow PyPI - Version

lazy_fred: Effortless FRED Data Collection

lazy_fred is a Python library designed to simplify the process of collecting economic data from the Federal Reserve Economic Data (FRED) API. It automates searching for relevant series, filtering by frequency and popularity, and exporting the data into convenient CSV files.

Features

  • Automated Search: Searches FRED across various economic categories.
  • Filtered Selection: Selects series based on popularity and frequency (daily, weekly, monthly).
  • Error Handling: Includes retry mechanisms and logging for robust data collection.
  • CSV Export: Saves the collected data in separate CSV files for easy analysis.

Installation

  1. Clone the Repository:

    git clone https://github.com/your-username/lazy_fred.git
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Obtain a FRED API Key:

Usage

  1. Configure Search Categories:

    • Modify the search_categories list in the script to include the categories of interest. The defualt list of 30 items have been chosen from the structure of the FRED website navigation and some personal decisions.
  2. Run the Script:

    python lazy_fred.py
  3. Output:

    • The script will create three CSV files in your project directory:
      • filtered_series.csv: Contains the search results from FRED cleaned to popularity over 50 and observation starts after 1900.
      • daily_data.csv: Contains daily time series data.
      • monthly_data.csv: Contains monthly time series data.
      • weekly_data.csv: Contains weekly time series data.

Code Structure

  • AccessFred Class:

    • Handles API key retrieval and validation.
  • collect_categories Class:

    • Executes searches across categories and consolidates results.
  • daily_export, monthly_export, and weekly_export Classes:

    • Filter series by frequency and popularity.
    • Collect and export time series data.

Packaging: pypi.org/project/lazy_fred/

The code has been packaged and can also be pip installed as

pip install lazy_fred

Make sure you are on the latest version (https://pypi.org/project/lazy_fred/).

Package Instructions

The code is simple, create and instance and add your API key!

import lazy_fred as lf
lf.run_fred_data_collection("insert_api_key_here")

Contributions

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License.

Disclaimer

This library is not affiliated with or endorsed by the Federal Reserve Bank of St. Louis or the FRED project.

Acknowledgments

  • This project utilizes the fredapi and fred libraries for interacting with the FRED API.

Contact

For any questions or feedback, please open an issue in the repository.

lazy_fred's People

Contributors

jasonb-zadv avatar jmetrics86 avatar

Stargazers

 avatar

Watchers

 avatar

lazy_fred's Issues

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.