Coder Social home page Coder Social logo

oec-etl's Introduction

OEC ETL

Setup

1. Clone the repo

$ https://github.com/observatory-economic-complexity/oec-etl
$ cd oec-etl

2. Add environment variables

Use the following as a guide/template for a .env file:

export CLICKHOUSE_URL="127.0.0.1"
export CLICKHOUSE_DATABASE="oec_test"

3. Run an example pipeline

The countries dimension pipeline is super fast to run and a great way to test that your setup works.

$ python etl/dim_countries_pipeline.py

Naming Convention for Tables

When adding a new pipeline script, please use the following naming convention:

Fact tables

Format: <type>_<depth>_<identifier>_<frequency>_<classification>

Params:

type: What the fact table represents (trade, tariffs, services, etc.). depth: i for international and s subnational data. identifier: For subnational data, this should be the iso3 for the reporter country. For international data, this should be the organization reporting the data. depth: a for annual and m for monthly. classification: The classification used by this table.

Examples:

trade_s_bra_a_hs for annual Brazilian subnational trade data using the HS classification

trade_i_comtrade_m_hs for monthly international Comtrade trade data using the HS classification

Dimension tables

Format: dim_<identifier>_<dimension>

Params:

identifier: For subnational data, this should be the iso3 id for the reporter country. For international data, this should say shared.

dimension: The name of the dimension held in this table.

Examples:

dim_shared_countries for a shared countries table

dim_rus_regions for a Russia dimension table representing national regions

Example queries

oec-etl's People

Contributors

alexandersimoes avatar marcioporto avatar mbarbierif avatar praveen-saini 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.