Skip to main content

'A simplified aggegate of FRED data using fredapi package'

Project description

lazy_fred_social

example workflow PyPI - Version

lazy_fred: Effortless FRED Data Collection

lazy_fred is a Python library designed to simplify collecting economic data from the Federal Reserve Economic Data (FRED) API. It searches across categories, filters series by popularity/frequency, and exports results to CSV files.

Features

  • Automated search across FRED categories
  • Filtered selection by frequency (daily/weekly/monthly) and popularity
  • Retry and logging for robust data collection
  • CSV exports for the filtered series + daily/weekly/monthly observations

Installation

From PyPI (recommended)

python -m pip install --upgrade lazy_fred

From source (Poetry)

poetry install

Configure your FRED API key

lazy_fred expects a FRED API_KEY. You can provide it either by:

  1. Creating a local .env file in your working directory:
    API_KEY=your_fred_api_key_here
    
  2. Or exporting it as an environment variable:
    set API_KEY=your_fred_api_key_here
    

If API_KEY is missing, the CLI will prompt you for it and write it to .env.

Quick start (CLI)

After installation, run:

lazy-fred

The CLI is interactive and will prompt you to:

  • add/remove/clear categories
  • run the data collection

Note: because it uses input(), it is intended for interactive terminals.

Output files

When you choose run, the project will generate these CSV files in your current directory:

  • filtered_series.csv
  • daily_data.csv
  • weekly_data.csv
  • monthly_data.csv

Programmatic usage

import lazy_fred as lf

lf.run_fred_data_collection("insert_api_key_here")

This will also start the interactive menu (it blocks on input()).

Development

  • Lint: poetry run ruff check .
  • Tests (requires a real key): API_KEY=<your_key> poetry run pytest

Release process

1) Bump version

Update version in pyproject.toml (for example, 0.1.66 -> 0.1.67), then commit and push.

2) Publish via GitHub Trusted Publishing (recommended)

This repository includes .github/workflows/publish-pypi.yml.

It publishes to PyPI automatically when you:

  • publish a GitHub Release, or
  • push a version tag matching v* (example: v0.1.67)

Example:

git tag v0.1.67
git push origin v0.1.67

Requirements:

  • PyPI project lazy_fred must have this GitHub repository configured as a Trusted Publisher.

3) Poetry fallback publish (manual)

If you need a manual fallback path, run the same GitHub workflow from the Actions tab with:

  • publish_method = poetry

This method uses:

  • poetry publish --build --skip-existing
  • repository secret PYPI_API_TOKEN

4) Verify release

After publish, confirm the new version appears at:

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.

Contributions

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

License

MIT

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

lazy_fred-0.1.66.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazy_fred-0.1.66-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file lazy_fred-0.1.66.tar.gz.

File metadata

  • Download URL: lazy_fred-0.1.66.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lazy_fred-0.1.66.tar.gz
Algorithm Hash digest
SHA256 3bc447f12884bba2289ba8ab08bad68e2acffd66c9408d2933c87a4d7a57243c
MD5 ce5ba9b6144d9d4f837226b488f8180e
BLAKE2b-256 75601d9386d52fa0026c261474612f8602ba1a830ca696818629f4824cbc08e7

See more details on using hashes here.

File details

Details for the file lazy_fred-0.1.66-py3-none-any.whl.

File metadata

  • Download URL: lazy_fred-0.1.66-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lazy_fred-0.1.66-py3-none-any.whl
Algorithm Hash digest
SHA256 93568ed9ca50e8818d47db280b35bddd8b424653ab0d8696d3bd30844896e71c
MD5 066ae32c501a7cb66c85c9187965f49e
BLAKE2b-256 e1f954d1009dae432c1d7368786d982fcb6a99fa6fcfbe4cb5193e54f9ec59c0

See more details on using hashes here.

Supported by

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