Skip to main content

BigQuery ETL Tools

Project description

BigQuery Ingest Utils

This package contains helper utilities to make it easier to ingest data into BigQuery. The main functionality is to help ingest data from local dataframes or files. The main assumption of this package is that your data can be loaded into a polars dataframe and uploaded from there into bigquery, either directly or via cloud storage.

Note: This package is biased towards certain data structures and file configurations, at the benefit of saved time to get something working.

Local Development

To use the package locally, authenticate with GCP using OAuth:

gcloud auth application-default login
gcloud config set project YOUR_PROJECT_ID

Setup environment for local development:

conda create -n bigquery_etl_tools pip
conda activate bigquery_etl_tools
pip install -r requirements.txt

Optionally, install ipykernel if developing in jupyter notebooks:

pip install ipykernel

Testing

The tests for this package are created using pytest, for some of the tests you will need to specifiy variables which are specfic to your GCP environment. To do that create a .env file in the root of the repository and set the following values:

BUCKET='bucketname'
DATASET='datasetname'

To run pytest run the following command on the command line:

pytest # full run

pytest tests/MODULE_NAME.py # module run

Build the Package

See the package here: https://pypi.org/project/bigquery-etl-tools/

To build the package using twine run the following on the command line in the root directory:

python setup.py sdist bdist_wheel # build the distribution
twine check dist/* # check everything has built correctly
twine upload dist/* # upload to pypi

To install the package into an environment run:

pip install bigquery-etl-tools

@TODO turn this into github action

Examples

See notebook.ipynb for example use cases.

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

bigquery_etl_tools-0.0.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

bigquery_etl_tools-0.0.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bigquery_etl_tools-0.0.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for bigquery_etl_tools-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a485ffde9e973c8593388eaa55e04618eaa93573a6e2a7ab88acf2d88978f17b
MD5 1b0996a7b8e3badae5f4fc1c3fc8ac42
BLAKE2b-256 7cab576a2c6145fba1366c0189fdbfa3930164d5fd015df55b0ecfd7ed46fcae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bigquery_etl_tools-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b03816218287d868352c6947163e6ca66f00f17c74ad2d52961a26480c7023c
MD5 10b27d1154ac87c9f8a2b7f4cf2d30dd
BLAKE2b-256 28d4313b1970379c35926c3e3aa87ab1610992fcad670e35de9b1010b5c16d65

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