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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bigquery_etl_tools-0.0.4.tar.gz.
File metadata
- Download URL: bigquery_etl_tools-0.0.4.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec7628c6960722fa7030afcc56324464e1a700173c5e494bb7c5ad81fb2e86f6
|
|
| MD5 |
f1ed3e5f414286a88b561ed8a546fc1f
|
|
| BLAKE2b-256 |
79c0d87216a648a0dc8ee399d3638d13165a94fc5f15a39b29aee6d437f52861
|
File details
Details for the file bigquery_etl_tools-0.0.4-py3-none-any.whl.
File metadata
- Download URL: bigquery_etl_tools-0.0.4-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c8dc9c887d4b4ae435c82ee7166bd5fb19890225d35ccb542d198512d7d138b
|
|
| MD5 |
569d2903e014f0d368d99e81f7bd3701
|
|
| BLAKE2b-256 |
d18451a4798476b2c83b2a465ea04d9c4c6f7336df8d6538bc383eb8c16ec6b7
|