Python wrapper for the US Federal Reserve FRED API
Project description
pyfred FRED API Client
Installation
-
Install the package:
pip install pyfred24
-
Create a
.envfile in your program root directory with your API key:FRED_API_KEY=your_api_key_here
Usage
from pyfred24 import FredAPIClient
client = FredAPIClient(
# api_key: str (Optional)
# if not provided, will look for the FRED_API_KEY environment variable
)
# Get category children in a dataframe format
category_children = client.category.children.get_dataframe(category_id=0)
print(category_children)
# Get series observations in json -> dict format
series_observations = client.series.observations.get_data(series_id='GNPCA')
print(series_observations)
# access the ".frame" attribute to get the data in a pandas dataframe
print(series_observations.frame)
# access the raw response
print(client.series.observations.get(series_id='GNPCA'))
# Get the release dates for a series
release_dates = client.series.release_dates.get_dataframe(series_id='GNPCA')
print(release_dates)
# Get the series search results in a dataframe format
series_search = client.series.search.get_dataframe(search_text='GDP')
print(series_search)
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
pyfred24-0.1.tar.gz
(3.7 kB
view details)
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 pyfred24-0.1.tar.gz.
File metadata
- Download URL: pyfred24-0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d827c977eec4aa8a027f75a78a6f297a51c2dc847fa46e2c592a05479467ab5
|
|
| MD5 |
27694bb44cce1b5f56ac5d9022df9b4a
|
|
| BLAKE2b-256 |
2d80c628c304352d33fc740912ebb20ef94a1fef7e15e0472c9e0fb681d4e3a3
|
File details
Details for the file pyfred24-0.1-py3-none-any.whl.
File metadata
- Download URL: pyfred24-0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e821702538d70f9dac30a63fa2c681414922c8f62ffe3f34ade7f36ba698b35
|
|
| MD5 |
ebbc99ba1168af49d70416c467f556c3
|
|
| BLAKE2b-256 |
2106e2b9016d1e2e89bb1d11137c0a9c318ee182cbc08dd80aafbfe218f4a266
|