Skip to main content

Simple BigQuery ETL

Project description

A Simple Google BigQuery ETL

Tired of messy execution pipelines? Drop a few .sql files into a directory, e.g. foo.sql, bar.sql and call executeTemplates() with some parameters. It will resolve dependencies between these SQL statements, execute them in correct order sending the output to a table with a unique name which includes the hash of the SQL. If the table already exists, it will not be executed again. Tables will eventually expire so you do not need to worry about deleting them.

For more details see example directory.

The only dependencies of this package are google-cloud-bigquery and google-cloud-storage.

It is purposely made bare-bones. If you want a feature such as a specific export format other than .csv.gz, etc. - pull requests are more than welcome.

Installation

  pip install bq_etl

Description

A module to execute BigQuery ETL jobs comprising of multiple interdependent SQL statements with no configuration other than the SQL itself. It can infer dependencies, execute the SQL in correct order, and optionally extract and download the table data.

Similarly to how compilers compile programs, if any of the steps (execution, extract or download) are already completed, they are not repeated again. This module does not need any external tools or configuration to keep track of its state - it is entirely based on what is in BigQuery, GCS or your local filesystem.

The key hack is that the actual BigQuery output table names are postfixed with short hashes of the SQL statements thereby making them unique and specific to the tables. Changing the SQL will result in a different table name.

License

Apache 2.0

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

bq_etl-0.0.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

bq_etl-0.0.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file bq_etl-0.0.2.tar.gz.

File metadata

  • Download URL: bq_etl-0.0.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for bq_etl-0.0.2.tar.gz
Algorithm Hash digest
SHA256 24b0677c19a0a4ba16b1306d9fa3a32125048c8565a51c23455c3bd0b8f66f9f
MD5 3248d8114a9068dbb78b3aa052b863d9
BLAKE2b-256 844a10be7275508abe061f7eeb2401c2d833f755ed0be99d4b463d7a2a50419b

See more details on using hashes here.

File details

Details for the file bq_etl-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: bq_etl-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for bq_etl-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4709d15c55deaddfbcb9b1e854231d6e16fb661b39838698a59d2be3c8678f79
MD5 ccdca495f52ce35b0a5c94ccdc2661ff
BLAKE2b-256 a1267eedab87661613241a6353a3a19e6fa0479b8e6ef5b7a5d5e96cfe5adcad

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