Skip to content

Commit 969f901

Browse files
committed
update readme, gitignore
1 parent 5086973 commit 969f901

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# envrc
2+
.envrc
3+
14
# JetBrains
25
.idea/
36

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# fred_py_api
2-
FRED API Python Wrapper
1+
# Fred Python API
2+
A fully-featured FRED Python Wrapper.
33

4-
### FRED Reference
5-
- [Fred API Documentation](https://fred.stlouisfed.org/docs/api/fred/)
4+
### FRED References:
5+
- [API Documentation](https://fred.stlouisfed.org/docs/api/fred/)

src/fredapi/api/fred_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Fred API Client.
44
"""
55
from http import HTTPStatus
6+
from os import environ
67

78
import requests
89

@@ -14,7 +15,10 @@ class FredClient(object):
1415

1516
def __init__(self, api_key: str = None, base_client=None):
1617
"""Init client."""
17-
assert api_key or base_client, "Fred API Client or API Key required to use FredAPISeries"
18+
if not base_client:
19+
base_client = environ.get("FRED_API_KEY", None)
20+
21+
assert api_key or base_client, "Fred API Client or API Key required to use FredAPI"
1822

1923
if base_client and isinstance(base_client, FredClient):
2024
self._api_key = base_client.get_api_key()

0 commit comments

Comments
 (0)