Metadata-Version: 2.4
Name: fredcollect
Version: 0.1.2
Summary: A Python wrapper for the Federal Reserve Economic Database (FRED) API
Home-page: https://github.com/versaucc/fredcollect
Author: Oliver Grenon
Author-email: Oliver Grenon <grenonoliver@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/versaucc/fredcollect
Project-URL: Repository, https://github.com/versaucc/fredcollect
Project-URL: Issues, https://github.com/versaucc/fredcollect/issues
Keywords: FRED,Federal Reserve,Economic Data,API,Economics
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: pandas>=1.5.3
Requires-Dist: numpy>=1.23.5
Requires-Dist: python-dotenv
Requires-Dist: matplotlib
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: isort; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python


# FredCollect

A modern Python wrapper for the Federal Reserve Economic Database (FRED) API.

## Installation

### From PyPI (recommended)
```bash
pip install fredcollect
```

### From source
1. Clone this repository:
```bash
git clone https://github.com/versaucc/fredcollect.git
cd fredcollect
```

2. Install the package:
```bash
pip install -e .
```

## Quick Start

1. Set up your FRED API key:
```bash
cp .env.example .env
# Edit .env and add your FRED API key
```

2. Verify the installation:
```python
from fredcollect import run
```

## Usage

Run a simple test:
```python
from fredcollect import run  
print(run.run_series_updates())
```

This will print the first and last 5 rows of the most recently updated series. 
This doesn't however, retrieve the observed values that were updated to the series. 

To do this we can take note of the id (series_id) and date: 
```python
from fredcollect import run
df = run.run_series_updates()
for row in df.loc[:,['id', 'title', 'last_updated']].itertuples(index=False):
    print(f"{row.title}:\n{run.run_series_observations(series_id=row.id, observation_start=row.last_updated)}") 
```
        
Will effortlessly fetch and print the series title and observations from that series. (I recommend adding a delay.)  
Likely you will find it easier to create a batch file to collect data from instead of the CLI.   
Take a look at `tests/test.py` to see usage examples of every possible FRED endpoint.   
Following this, you'll want to peek at `fredcollect/parameters.py` to see what types of arguments can be made for each endpoint.  


## In progress 
Currently, all endpoints make successful requests with required only parameters.   
Except for series/observations - which cleans datetime objects  
All functions can and will break when passed:   
    -Obscure arguments: like an extremely unpopular category id, discontinued series id, search text with certain symbols   

Issues with string formatting are next up on the boilerplate.  

Automated filesave:   
    -In /data_pipeline (currently obsolete) DataFrames and parameters passed here to automate the organization, naming, and saving of datasets.   
    -Maybe xlsx, likely csv.   

MatplotLib:   
    -Graphing, matching, statarb, etc.   


## License

Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0
