Skip to content
ryansherby edited this page Jan 5, 2023 · 8 revisions

Welcome to the BLS-Transformer wiki!

Getting Started

Import Module

from bls_transformer import BLS

Initialize Module

bls = BLS.API(series_id=[<YOUR SERIES ID(S)>],*)

Converting Data

To show the raw JSON dictionary, use bls.json_response. Otherwise, proceed with the command bls.transform_json() to initialize the data dictionary.

Accessing the Data

Get DataFrame

df = bls.get_DataFrame(id=[<YOUR SERIES ID(S)>],index=[<INDEX>],axis=<DEFAULT=1>)
  • Returns a DataFrame concatenated on the Series ID of each individual DataFrame.
  • A DataFrame's index is the same as the order in which the Series it corresponds to was initialized, starting at zero.
  • The first DataFrame requested will always possess the 'Period' key concatenated on. This will lead to odd results if DataFrames with different periods (e.g., monthly/quarterly) are concatenated within the same get_DataFrame() request.

Get Catalog

catalog = bls.get_catalog(id=[<YOUR SERIES ID(S)>],index=[<INDEX>])
  • Returns a list of JSON dictionaries containing information about the requested Series.
  • A catalog's index is the same as the order in which the Series it corresponds to was initialized, starting at zero.
Clone this wiki locally