Skip to main content

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')

Release files for beasy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beasy 1.0.0
File Size Uploaded
beasy-1.0.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beasy 1.0.0
File Interpreter ABI Platform
beasy-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / beasy-1.0.0.tar.gz

Download URL beasy-1.0.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7626e0150490d9d000ab71a624180358b86b04c9a7d7ae47b41653d39e5b6f40
BLAKE2b-256 checksum
How to use checksums
6e1be2740317977f2432392abcbc4ba54212e80058a5fdf69ac67fcc9cc53064
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / beasy-1.0.0-py3-none-any.whl

Download URL beasy-1.0.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc76ac87ae519a8cda7c6bd0d62e65e58af3d591b29e1cc60f7fdd957f0d8d58
BLAKE2b-256 checksum
How to use checksums
9f234bf9ada05cb6b64ce941d2017c865c30e59d0785f039b4c3028b9925257e
Upload date
Uploaded using Trusted Publishing?
What is 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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page