'A simplified aggegate of FRED data using fredapi package'
Project description
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:
- Creating a local
.envfile in your working directory:API_KEY=your_fred_api_key_here
- 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.csvdaily_data.csvweekly_data.csvmonthly_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_fredmust 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bc447f12884bba2289ba8ab08bad68e2acffd66c9408d2933c87a4d7a57243c
|
|
| MD5 |
ce5ba9b6144d9d4f837226b488f8180e
|
|
| BLAKE2b-256 |
75601d9386d52fa0026c261474612f8602ba1a830ca696818629f4824cbc08e7
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93568ed9ca50e8818d47db280b35bddd8b424653ab0d8696d3bd30844896e71c
|
|
| MD5 |
066ae32c501a7cb66c85c9187965f49e
|
|
| BLAKE2b-256 |
e1f954d1009dae432c1d7368786d982fcb6a99fa6fcfbe4cb5193e54f9ec59c0
|