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.3.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.3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bigquery_etl_tools-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ea485098481d8cc6e778c92ac12bffe4a987e60010ff1a6779f8dc575f5fa998
MD5 30da59d1ce48e6b1ca79825dcb6994b7
BLAKE2b-256 8b16454e25fe75335a291472e523b325afae8474b43c22e4dbf01200be122e77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bigquery_etl_tools-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee2bd0ea57a763800a61da3af291f3eceddf68a02a24dcaf3f34d2acedd0283
MD5 4ea5b26ffd9e85f4fd9bbb2a931d97cf
BLAKE2b-256 cab53efd1ed50f4f4844ccb00b978cb4748b4b55d8b249de2dd2d6e22079b408

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