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

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

python setup.py sdist bdist_wheel

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.1.tar.gz (6.7 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.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bigquery_etl_tools-0.0.1.tar.gz
  • Upload date:
  • Size: 6.7 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.1.tar.gz
Algorithm Hash digest
SHA256 e4c0f9ea545bbe904f44d9fe976ce2d2a0dd2a8cec6177348355a5003b86cb7c
MD5 61c4c72b4ccf00c6ccc08cb467c3a770
BLAKE2b-256 90d0a94b997ff546a0c36bf8cacd8cf76a550fa3341ec8068a3d937ad605e417

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bigquery_etl_tools-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b498487ac8343b97b3d614a2fb8edb8b1b31047459f0e4c00a20ef70791a9089
MD5 6bb78c4575952033fdfc444df1da2717
BLAKE2b-256 401b25e3f9df88be2202b8c0f4bfdecd3d4b8ee30a01582edd88636370f511a2

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