Simple Python API client for accessing data on the Bureau of Economic Analysis application programming interface.
Project description
Simple BEA Client
Installation
pip install beasy
Description
This library is an unofficial Python API client for U.S Bureau of Economic Analysis API.
You can view the developer guide for the API here. This is not the user guide for this client library. However, it will provide useful information on how this library interacts with the API.
Purpose
Other BEA client libraries exist for accessing the API. However, in my opinion, they are either too complicated or poorly conceived. Therefore, this library is a simple and straightforward client.
If complicated sorting, filtering, or formatting functions are desired, they will be added as utility functions that are not part of the client module.
Usage
Currently, the library is designed to return JSON response objects from the BEA API, not XML.
from beasy.beasy import Bea
API_KEY = 'your_api_key'
client = Bea(API_KEY)
Get Dataset List
"...retrieves a list of the datasets currently offered."
client.getDatasetList()
Get Parameter List
"...retrieves a list of the parameters(required and optional) for a particular dataset."
client.[table_name].getParameterList()
client.Regional.getParameterList()
Get Parameter Values
"...retrieves a list of the valid values for a particular parameter."
client.[table_name].getParameterValues(parameter)
client.Regional.getParameterValues('LineCode')
Get Parameter Values Filtered
"...retrieves a list of the valid values for a particular parameter based on other provided parameters."
client.[table_name].getParameterValuesFiltered(targetParameter, **kwargs)
client.Regional.getParameterValuesFiltered('LineCode', 'SAINC1')
Get Data
client.[table_name].getData(**kwargs)
client.Regional.getData(TableName='CAINC1', LineCode='3', GeoFIPS='DE', Year='2014')
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
Built Distribution
File details
Details for the file beasy-1.0.0.tar.gz
.
File metadata
- Download URL: beasy-1.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7626e0150490d9d000ab71a624180358b86b04c9a7d7ae47b41653d39e5b6f40 |
|
MD5 | 256c1b3c31aaefb7e7c1109fdc80c0c4 |
|
BLAKE2b-256 | 6e1be2740317977f2432392abcbc4ba54212e80058a5fdf69ac67fcc9cc53064 |
File details
Details for the file beasy-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: beasy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc76ac87ae519a8cda7c6bd0d62e65e58af3d591b29e1cc60f7fdd957f0d8d58 |
|
MD5 | 969aa4ab2e1c953f1ebd2a09b7c55f3b |
|
BLAKE2b-256 | 9f234bf9ada05cb6b64ce941d2017c865c30e59d0785f039b4c3028b9925257e |