GithubHelp home page GithubHelp logo

econ_data's Introduction

BLS & BEA - Python Database API Connection

This repository contains Python files that facilitate the extraction of data from the BLS (Bureau of Labor Statistics) and BEA (Bureau of Economic Analysis) databases using their respective APIs. The provided Python scripts allow you to establish a connection with the databases and retrieve the desired data for further analysis or processing.

Prerequisites

Required Python libraries: 'requests', 'json', 'pandas'

BLS API Connection

The BLSdata file provides a Python function BLSData that connect to the BLS database using its API. It provides methods to authenticate, query data, and retrieve the results in a structured format.

To use the BLS API, follow these steps:

  1. Obtain your BLS API key from the BLS API Registration page. In the file, copy your API key to the variable bls_key as default.
  2. Go to BLS website to find the Series ID.
  3. Implement your desired data query by adding seriesID, startYr and endYr in the BLSdata function.
  4. Run the bls_api.py file to execute your query and retrieve the data from the BLS database.

BEA API Connection

The BEAdata file provides a Python function BEAData that enables connecting to the BEA database using its API. It offers methods to authenticate, query data, and obtain the results in a structured format.

To utilize the BEA API, follow these steps:

  1. Obtain your BEA API key from the BEA Data API page. In the file, copy your API key to the variable api_key as default.
  2. Go to BEA NIPA Tables to find the table name.
  3. Implement your desired data query by adding tablename, frequency and year in the BEAdata function.
  4. Execute your query and retrieve the data from the BEA database.

Example Usage

The repository includes example usages of both the BLS and BEA API connections in the example_usage.py file. You can refer to this file to understand how to retrieve data from the respective databases.

econ_data's People

Contributors

cambrianmacroresearch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.