pyfred-client 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyfred/__init__.py +53 -0
- pyfred/__main__.py +14 -0
- pyfred/core.py +2257 -0
- pyfred/py.typed +0 -0
- pyfred_client-0.2.0.dist-info/METADATA +390 -0
- pyfred_client-0.2.0.dist-info/RECORD +9 -0
- pyfred_client-0.2.0.dist-info/WHEEL +4 -0
- pyfred_client-0.2.0.dist-info/entry_points.txt +2 -0
- pyfred_client-0.2.0.dist-info/licenses/LICENSE +21 -0
pyfred/__init__.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Public package interface for :mod:`pyfred`.
|
|
3
|
+
|
|
4
|
+
This package wraps the FRED and ALFRED API of the Federal Reserve Bank of
|
|
5
|
+
St. Louis: hundreds of thousands of economic time series, each with its
|
|
6
|
+
history of revisions (vintages), organised by categories, releases and tags.
|
|
7
|
+
The implementation lives in :mod:`pyfred.core`; the names most callers need
|
|
8
|
+
are re-exported here, so ``from pyfred import FredClient`` is enough.
|
|
9
|
+
|
|
10
|
+
Exports:
|
|
11
|
+
FredClient: The client for series, observations, vintages and listings.
|
|
12
|
+
UNITS: FRED's ``units`` transformations (``pch``, ``pc1``, ``log``, ...).
|
|
13
|
+
FREQUENCIES: FRED's ``frequency`` aggregation codes.
|
|
14
|
+
AGGREGATIONS: FRED's ``aggregation_method`` codes.
|
|
15
|
+
OUTPUT_TYPES: FRED's ``output_type`` codes for real-time observations.
|
|
16
|
+
EARLIEST: The earliest real-time day (``1776-07-04``).
|
|
17
|
+
LATEST: The latest real-time day (``9999-12-31``, "still current").
|
|
18
|
+
BASE_URL: Root of the FRED API.
|
|
19
|
+
KEY_ENV: The environment variable read for the API key.
|
|
20
|
+
main: Entry point for the ``python-fire`` command-line interface.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
from pyfred.core import (
|
|
26
|
+
AGGREGATIONS,
|
|
27
|
+
BASE_URL,
|
|
28
|
+
EARLIEST,
|
|
29
|
+
FREQUENCIES,
|
|
30
|
+
KEY_ENV,
|
|
31
|
+
LATEST,
|
|
32
|
+
OUTPUT_TYPES,
|
|
33
|
+
RATE_LIMIT,
|
|
34
|
+
UNITS,
|
|
35
|
+
FredClient,
|
|
36
|
+
RateLimitError,
|
|
37
|
+
main,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"AGGREGATIONS",
|
|
42
|
+
"BASE_URL",
|
|
43
|
+
"EARLIEST",
|
|
44
|
+
"FREQUENCIES",
|
|
45
|
+
"KEY_ENV",
|
|
46
|
+
"LATEST",
|
|
47
|
+
"OUTPUT_TYPES",
|
|
48
|
+
"RATE_LIMIT",
|
|
49
|
+
"UNITS",
|
|
50
|
+
"FredClient",
|
|
51
|
+
"RateLimitError",
|
|
52
|
+
"main",
|
|
53
|
+
]
|
pyfred/__main__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Module entry point enabling ``python -m pyfred``.
|
|
3
|
+
|
|
4
|
+
Running the package as a module delegates to :func:`pyfred.core.main`, which
|
|
5
|
+
launches the Fire-generated command-line interface, the same as the
|
|
6
|
+
``pyfred-client`` console script.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from pyfred.core import main
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|