https://github.com/deepwaterpaladin/fred_api
Data extraction project using FRED API
https://github.com/deepwaterpaladin/fred_api
data-science economics python
Last synced: 6 months ago
JSON representation
Data extraction project using FRED API
- Host: GitHub
- URL: https://github.com/deepwaterpaladin/fred_api
- Owner: deepwaterpaladin
- Created: 2022-07-21T15:07:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T00:39:25.000Z (about 2 years ago)
- Last Synced: 2024-05-06T01:35:49.818Z (about 2 years ago)
- Topics: data-science, economics, python
- Language: Python
- Homepage:
- Size: 96.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
## Getting Started
1. Install dependencies -> `pip install requirements.txt`
1. create `.env` file
1. add `API_KEY` constant to `.env` file & add API key
## Using the Package
1. files in the `src` directory are up to date
1. `commodities.py` features:
- `Commodity()` class is the main class
- `Metals()`, `Agriculture()`, `Energy()`, & `Livestock()` are subclasses of `Commodity()`
- `Metals()`: `IronOre()`, `Copper()`, `Aluminum()`, `Lead()`, `Zinc()`, `Nickel()`, `Tin()`, & `Uranium()`
- `Agriculture()`: `Corn()`, `Soybeans()`, `Wheat()`, `Cotton()`, `Barley()`, `Coffee()`, `Cocoa()`, `Bananas()`, & `OliveOil()`
- `Energy()`: `Natural Gas()`, & `Oil()`
- `Livestock()`: `Shrimp()`, `Swine()`, `Beef()`, `Shellfish()`, `Lamb()`, `Poultry()`, & `Fish()`
- Data can be accessed via `x_week/month_price()` method with x being the number of weeks/months
- returns a pandas dataframe
- Plot the data via the `plot()` method
- returns a `plotly` chart
1. `monetary_base.py` features:
- `MonetaryBase()` is the main class
- `TotalMB()`, `Currency()`, `Reserve()`, `SwissMB()`, `M1()`, `M1Velo()`, `M2()`, & `M2Velo()` are the subclasses
1. `exchange_rate.py` features:
- `SpotRate()` is the main class
1. As files in the `src` directory are updated, the `README.md` file will be updated to reflect the changes (eventually this will be `__init__.py` file being updated once this is a proper package)
## About FRED API
- The Federal Reserve Economic Data (FRED) API is a web service for obtaining economic data from the Federal Reserve Bank of St. Louis.
- The FRED API is a RESTful web service that returns data in JSON, XML, or CSV format. The FRED API is free to use.
- [FRED API Documentation](https://fred.stlouisfed.org/docs/api/fred/)
## TODO
1. Refactor following files in the style of `class Oil` in `commodities.py`:
- [ ] `bonds.py`
- [X] `business_expectations.py`
- [X] `commodities.py`
- [X] `consumer_credit.py`
- [ ] `delinquency.py`
- [X] `exchange_rate.py`
- [ ] `housing.py`
- [X] `monetary_base.py`
- [ ] `producer_prices.py`
- [ ] `stocks.py`
- [ ] `uncertainty.py`
- [ ] `unemployment.py`
1. Add method to standardize units in commodities.py
1. Add more data to the database