Skip to main content

No project description provided

Project description

BEAquery

PyPI - Version PyPI - Python Version


Table of Contents

BEA query is a set of commands to investigate, retrieve, or view datasets provided by BEA.

beaillustrated collects information about all of the BEA datasets, their parameters, and parameter values. It then displays this information in your browser

The remaining commands retrieve and either store data in CSV files or display the data along with interactive plots in your browser.

beaqueryq can be used to do all that the commands above do.

I have changed the arguments to the commands to correspond with those used by BEA.

Installation

pip install beaquery

Usage


##
## beaillustrated
##
usage: beaillustrated [-h] [--format {json,XML}] [--directory DIRECTORY]

display BEA data model

options:
-h, --help show this help message and exit
--format {json,XML} requested BEA result format(json)
--directory DIRECTORY
where to store the generated html


##
## beafixedassets
##
usage: beafixedassets [-h] --TableName TABLENAME --Year YEAR
[--format {json,XML}] [--csvfn CSVFN]
[--csvzipfn CSVZIPFN] [--splitkey SPLITKEY]
[--xkey XKEY] [--ykey YKEY] [--unitskey UNITSKEY]
[--htmlfn HTMLFN]

get BEA FixedAssets data

options:
-h, --help show this help message and exit
--TableName TABLENAME
FixedAssets table name
--Year YEAR year YYYY or X for all years
--format {json,XML} result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(LineDescription) to use to split the
plots
--xkey XKEY table column name(TimePeriod) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(METRIC_NAME) to use to label the
data
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beagdpbyind
##
usage: beagdpbyind [-h] --TableID TABLEID --Industry INDUSTRY --Frequency
FREQUENCY --Year YEAR [--format {json,XML}]
[--csvfn CSVFN] [--csvzipfn CSVZIPFN]
[--splitkey SPLITKEY] [--xkey XKEY] [--ykey YKEY]
[--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA GDPbyIndustry data

options:
-h, --help show this help message and exit
--TableID TABLEID table id
--Industry INDUSTRY industry
--Frequency FREQUENCY
frequency M, Q, A or comma separated list
--Year YEAR year YYYY or ALL
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(IndustrYDescription) to use to split
the plots
--xkey XKEY table column name(Year) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY y key units(Billions?) to use to label the plotdata
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beaiip
##
usage: beaiip [-h] --TypeOfInvestment TYPEOFINVESTMENT --Component
COMPONENT --Frequency FREQUENCY --Year YEAR
[--format {json,XML}] [--csvfn CSVFN] [--csvzipfn CSVZIPFN]
[--splitkey SPLITKEY] [--xkey XKEY] [--ykey YKEY]
[--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA IIP data

options:
-h, --help show this help message and exit
--TypeOfInvestment TYPEOFINVESTMENT
type of investment
--Component COMPONENT
component of changes of position
--Frequency FREQUENCY
frequency M, Q, A or comma separated list
--Year YEAR year YYYY or ALL
--format {json,XML} result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(Component) to use to split the plots
--xkey XKEY table column name(TimePeriod) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(CL_UNIT) to use to label the data
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beainputoutput
##
usage: beainputoutput [-h] --TableID TABLEID --Year YEAR
[--format {json,XML}] [--csvfn CSVFN]
[--csvzipfn CSVZIPFN] [--splitkey SPLITKEY]
[--xkey XKEY] [--ykey YKEY] [--unitskey UNITSKEY]
[--htmlfn HTMLFN]

get BEA InputOutput data

options:
-h, --help show this help message and exit
--TableID TABLEID table id
--Year YEAR year YYYY or ALL
--format {json,XML} request result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(ColDescr) to use to split the plots
--xkey XKEY table column name(Year) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(ColType) to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beaissta
##
usage: beaissta [-h] --Channel CHANNEL --Destination DESTINATION --Industry
INDUSTRY --AreaOrCountry AREAORCOUNTRY --Year YEAR
[--format {json,XML}] [--csvfn CSVFN] [--csvzipfn CSVZIPFN]
[--splitkey SPLITKEY] [--xkey XKEY] [--ykey YKEY]
[--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA IntlServSTA data

options:
-h, --help show this help message and exit
--Channel CHANNEL channel
--Destination DESTINATION
destination
--Industry INDUSTRY industry
--AreaOrCountry AREAORCOUNTRY
area or country
--Year YEAR year YYYY or ALL
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(TimeSeriesDescription) to use to
split the plots
--xkey XKEY table column name(Year) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(CL_UNIT) to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beaistrade
##
usage: beaistrade [-h] --TypeOfService TYPEOFSERVICE
[--TradeDirection TRADEDIRECTION]
[--Affiliation AFFILIATION]
[--AreaOrCountry AREAORCOUNTRY] --Year YEAR
[--format {json,XML}] [--csvfn CSVFN]
[--csvzipfn CSVZIPFN] [--splitkey SPLITKEY] [--xkey XKEY]
[--ykey YKEY] [--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA IntlServTrade data

options:
-h, --help show this help message and exit
--TypeOfService TYPEOFSERVICE
type of service
--TradeDirection TRADEDIRECTION
trade direction
--Affiliation AFFILIATION
affiliation
--AreaOrCountry AREAORCOUNTRY
area or country
--Year YEAR year YYYY or ALL
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(TimeSeriesDescription) to use to
split the plots
--xkey XKEY table column name(Year) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(CL_UNIT) to use to label the data
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beaita
##
usage: beaita [-h] --Indicator INDICATOR --AreaOrCountry AREAORCOUNTRY
--Frequency FREQUENCY --Year YEAR [--format {json,XML}]
[--csvfn CSVFN] [--csvzipfn CSVZIPFN] [--splitkey SPLITKEY]
[--xkey XKEY] [--ykey YKEY] [--unitskey UNITSKEY]
[--htmlfn HTMLFN]

get BEA ITA data

options:
-h, --help show this help message and exit
--Indicator INDICATOR
ITA indicator
--AreaOrCountry AREAORCOUNTRY
ITA area or country
--Frequency FREQUENCY
frequency M, Q, A or comma separated list
--Year YEAR year YYYY or ALL
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(TimeSeriesDescription) to use to
split the plots
--xkey XKEY table column name(Year) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name({'option_strings': ['--unitskey'],
'dest': 'unitskey', 'nargs': None, 'const': None,
'default': 'CL_UNIT', 'type': None, 'choices': None,
'required': False, 'help': 'table column name(%s) to y
label the plot', 'metavar': None, 'container':
,
'prog': 'beaita'}) to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beamne
##
usage: beamne [-h] [--SeriesID SERIESID] --DirectionOfInvestment
DIRECTIONOFINVESTMENT --Classification CLASSIFICATION
[--Country COUNTRY] [--Industry INDUSTRY] --Year YEAR
[--format {json,XML}] [--csvfn CSVFN] [--csvzipfn CSVZIPFN]
[--splitkey SPLITKEY] [--xkey XKEY] [--ykey YKEY]
[--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA MNE data

options:
-h, --help show this help message and exit
--SeriesID SERIESID MNE series id
--DirectionOfInvestment DIRECTIONOFINVESTMENT
direction of investment
--Classification CLASSIFICATION
classification
--Country COUNTRY country
--Industry INDUSTRY industry
--Year YEAR year YYYY or all
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(SeriesName) to use to split the
plots
--xkey XKEY table column name(Year) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(TableScale) to to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beanipa
##
usage: beanipa [-h] --TableName TABLENAME [--ShowMillions SHOWMILLIONS]
--Frequency FREQUENCY --Year YEAR [--format {json,XML}]
[--csvfn CSVFN] [--csvzipfn CSVZIPFN] [--splitkey SPLITKEY]
[--xkey XKEY] [--ykey YKEY] [--unitskey UNITSKEY]
[--htmlfn HTMLFN]

get BEA NIPA data

options:
-h, --help show this help message and exit
--TableName TABLENAME
NIPA table name
--ShowMillions SHOWMILLIONS
NIPA show millions
--Frequency FREQUENCY
frequency M, Q, A or comma separated list
--Year YEAR year YYYY or X for all
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(LineDescription) to use to split the
plots
--xkey XKEY table column name(TimePeriod) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(METRIC_NAME) to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beaniud
##
usage: beaniud [-h] --TableName TABLENAME --Frequency FREQUENCY --Year YEAR
[--format {json,XML}] [--csvfn CSVFN] [--csvzipfn CSVZIPFN]
[--splitkey SPLITKEY] [--xkey XKEY] [--ykey YKEY]
[--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA NIUnderlyingDetail data

options:
-h, --help show this help message and exit
--TableName TABLENAME
NIUnderlyingDetail table name
--Frequency FREQUENCY
frequency M, Q, A or comma separated list
--Year YEAR year YYYY or X or all
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name({'option_strings': ['--splitkey'],
'dest': 'splitkey', 'nargs': None, 'const': None,
'default': 'LineDescription', 'type': None, 'choices':
None, 'required': False, 'help': 'table column
name(%s) to use to split the plots', 'metavar': None,
'container': 0x102a0b770>, 'prog': 'beaniud'}) to use to split
the plots
--xkey XKEY table column name(TimePeriod) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(METRIC_NAME) to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## bearegional
##
usage: bearegional [-h] --TableName TABLENAME --GeoFips GEOFIPS --LineCode
LINECODE --Year YEAR [--format {json,XML}]
[--csvfn CSVFN] [--csvzipfn CSVZIPFN]
[--splitkey SPLITKEY] [--xkey XKEY] [--ykey YKEY]
[--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA Regional data

options:
-h, --help show this help message and exit
--TableName TABLENAME
table name
--GeoFips GEOFIPS geo fips
--LineCode LINECODE line code
--Year YEAR year YYYY or ALL
--format {json,XML} query result format(json)
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(GeoName) to use to split the plots
--xkey XKEY table column name(TimePeriod) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY table column name(CL_UNIT) to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beaugdpbyind
##
usage: beaugdpbyind [-h] --TableID TABLEID --Industry INDUSTRY --Frequency
FREQUENCY --Year YEAR [--format {json,XML}]
[--csvfn CSVFN] [--csvzipfn CSVZIPFN]
[--splitkey SPLITKEY] [--xkey XKEY] [--ykey YKEY]
[--unitskey UNITSKEY] [--htmlfn HTMLFN]

get BEA UnderlyingGDPbyIndustry data

options:
-h, --help show this help message and exit
--TableID TABLEID table id
--Industry INDUSTRY industry
--Frequency FREQUENCY
frequency M, Q, A or comma separated list
--Year YEAR year YYYY or ALL
--format {json,XML} result format
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name(IndustrYDescription) to split the
plots
--xkey XKEY table column name(Year) to use to plot the data
--ykey YKEY table column name(DataValue) to use to plot the data
--unitskey UNITSKEY name(Billions?) to y label the plot
--htmlfn HTMLFN name of file to store dataset HTML result


##
## beaqueryq
##
usage: beaqueryq [-h]
[--DatasetName {NIPA,NIUnderlyingDetail,MNE,FixedAssets,ITA,IIP,InputOutput,IntlServTrade,IntlServSTA,GDPbyIndustry,Regional,UnderlyingGDPbyIndustry,APIDatasetMetaData}]
[--TableName TABLENAME] [--TableID TABLEID]
[--SeriesID SERIESID] [--ShowMillions SHOWMILLIONS]
[--Frequency FREQUENCY] [--Year YEAR]
[--DirectionOfInvestment {inward,outward,parent,state}]
[--Classification CLASSIFICATION] [--Industry INDUSTRY]
[--Country COUNTRY] [--Indicator INDICATOR]
[--AreaOrCountry AREAORCOUNTRY]
[--TypeOfInvestment TYPEOFINVESTMENT]
[--Component COMPONENT] [--TypeOfService TYPEOFSERVICE]
[--TradeDirection TRADEDIRECTION]
[--Affiliation AFFILIATION] [--Channel CHANNEL]
[--Destination DESTINATION] [--GeoFips GEOFIPS]
[--LineCode LINECODE] [--csvfn CSVFN]
[--csvzipfn CSVZIPFN] [--splitkey SPLITKEY] [--xkey XKEY]
[--ykey YKEY] [--unitskey UNITSKEY] [--htmlfn HTMLFN]
[--format {json,XML}] [--hierarchy] [--tableregister]

get BEA data

options:
-h, --help show this help message and exit
--DatasetName {NIPA,NIUnderlyingDetail,MNE,FixedAssets,ITA,IIP,InputOutput,IntlServTrade,IntlServSTA,GDPbyIndustry,Regional,UnderlyingGDPbyIndustry,APIDatasetMetaData}
dataset name
--TableName TABLENAME
NIPA NIUnderlyingDetail FixedAssets Regional table
name
--TableID TABLEID InputOutput GDPbyIndustry UnderlyingGDPbyIndustry
table id
--SeriesID SERIESID MNE series id
--ShowMillions SHOWMILLIONS
NIPA show millions
--Frequency FREQUENCY
frequency M, Q, A or comma separated list
--Year YEAR year YYYY X or all
--DirectionOfInvestment {inward,outward,parent,state}
MNE direction of investment
--Classification CLASSIFICATION
MNE classification
--Industry INDUSTRY MNE IntlServSTA GDPbyIndustry UnderlyingGDPbyIndustry
Industry
--Country COUNTRY MNE country
--Indicator INDICATOR
ITA indicator
--AreaOrCountry AREAORCOUNTRY
ITA IntlServTrade IntlServSTA area or country
--TypeOfInvestment TYPEOFINVESTMENT
IIP type of investment
--Component COMPONENT
IIP component
--TypeOfService TYPEOFSERVICE
IntlServTrade type of service
--TradeDirection TRADEDIRECTION
IntlServTrade trade direction
--Affiliation AFFILIATION
IntlServTrade affiliation
--Channel CHANNEL IntlServSTA channel
--Destination DESTINATION
IntlServSTA destination
--GeoFips GEOFIPS Regional geo FIPS
--LineCode LINECODE Regional line code
--csvfn CSVFN name of file to store dataset CSV result
--csvzipfn CSVZIPFN name of zip file to store dataset CSV results
--splitkey SPLITKEY table column name to use to split the table
--xkey XKEY table column name to use to plot the data
--ykey YKEY table column name to use to plot the data
--unitskey UNITSKEY table column name to use to label the data
--htmlfn HTMLFN name of file to store dataset HTML result
--format {json,XML} query result format
--hierarchy BEA data model
--tableregister get NIPA table register

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beaquery-0.0.23.tar.gz (154.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beaquery-0.0.23-py3-none-any.whl (165.0 kB view details)

Uploaded Python 3

File details

Details for the file beaquery-0.0.23.tar.gz.

File metadata

  • Download URL: beaquery-0.0.23.tar.gz
  • Upload date:
  • Size: 154.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for beaquery-0.0.23.tar.gz
Algorithm Hash digest
SHA256 99ddfc8ae3a0720d5e041d9bf06bec8ef876865c18ebbcd55cff94488c87c0e9
MD5 a0701f4cb280c2b9a1c17bfa5a68acbb
BLAKE2b-256 7ec67caa9bc09fd47de5ec6555c4e3d9a2c8089fbf4616957b2f6c9dcc5bc359

See more details on using hashes here.

File details

Details for the file beaquery-0.0.23-py3-none-any.whl.

File metadata

  • Download URL: beaquery-0.0.23-py3-none-any.whl
  • Upload date:
  • Size: 165.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for beaquery-0.0.23-py3-none-any.whl
Algorithm Hash digest
SHA256 512e828d5e8f665fdd5e35d2bc6ebd20d4e1b63584d66b2676d28f9f27dfda2c
MD5 713128aae2d2e1b58dbc18df3126ec5e
BLAKE2b-256 a06a6928ea0dc4b45f7d2287bc8cbdccc22e089932dd56558ee0f8ba6455d094

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page