A utility library that enhances the official BigQuery Python client by providing additional tools for efficient query management, data processing, and automation. Designed for developers and data scientists, `bigquery-advanced-utils` simplifies working with Google BigQuery.
Project description
bigquery-advanced-utils
BigQuery-advanced-utils is a lightweight utility library that extends the official Google BigQuery Python client.
It simplifies tasks like query management, data processing, and automation.
Aimed at developers and data scientists, the project is open to contributions to improve and enhance its functionality.
Why This Library?
I created bigquery-advanced-utils because I often found myself facing complex or uncommon tasks when working with BigQuery, and there was little or no support available online. Rather than spending time reinventing the wheel, I decided to create this library to help others avoid the same challenges. I hope that everyone can contribute in the same spirit, so feel free to get involved and make this library even better!
Requirements
- Python 3.10+
Installation 📦
Install via pip (recommended)
Run the following command in your terminal:
pip install bigquery-advanced-utils
Install in a Virtual Environment
- Create a virtual environment:
python -m venv venv
- Activate the environment and install:
source venv/bin/activate # on macOS/Linux
venv\Scripts\activate # on Windows
pip install bigquery-advanced-utils
Usage Examples 🚀
Quick Start
from bigquery_advanced_utils.bigquery import BigQueryClient
# Initialize helper with your project ID
helper = BigQueryClient(project_id="your_project_id")
# Load data from CSV
helper.load_data_from_csv(file_path="your_data.csv")
Data Validation
test_functions=[
partial(
# Check if any null values exist in the "age" column
b.check_no_nulls, columns_to_test=["age"],
),
partial(
# Ensure values in the "email" column are unique
b.check_unique_column, columns_to_test=["email"]
)
]
Search by table or owner in Datatransfer
from bigquery_advanced_utils.datatransfer import DataTransferClient
helper = DataTransferClient()
# Call the function with two parameters: owner email and project id
list_transfer_config_by_owner_email(owner_email="my-email@email.com", project_id="my-project")
# Get the scheduled queries by the name of a table (it's case sensitive)
list_transfer_configs_by_table(table_id="my-table", project_id="my-project")
Planned features 🚧
- A new query builder.
- Custom data transformation and processing functions.
- Exclusive features with datatransfer.
- Utility functions to manipulate strings and query.
Contributing
We are always open to contributions! Whether you have a bug fix, a feature request, or a general improvement to make, your help is appreciated. Here are some ways you can contribute:
- Bug reports: Help us catch issues before they affect users.
- New features: Suggest new functionalities that could improve the usability of the package.
- Code improvements: Review the code and suggest optimizations or fixes.
Please follow the contributing guide for more details on how to get started.
License
This project is licensed under the GNU General Public License. See the LICENSE file for details.
Contact
For questions or feedback, feel free to open an issue or reach out to me.
Project details
Release history Release notifications | RSS feed
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_advanced_utils-0.0.1.dev3.tar.gz.
File metadata
- Download URL: bigquery_advanced_utils-0.0.1.dev3.tar.gz
- Upload date:
- Size: 35.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3c12a81bb2b6b57a02e71c81ed708e69707d70ab37f5a3ec530f1a4f0befde0
|
|
| MD5 |
f38d93682640ef8168e51e39a39c009e
|
|
| BLAKE2b-256 |
6aac8707fc657895dd0b43a0ad1ed6600f65fe472f701f920d840903e696031f
|
Provenance
The following attestation bundles were made for bigquery_advanced_utils-0.0.1.dev3.tar.gz:
Publisher:
publish-to-pypi.yml on Alessio-Siciliano/bigquery-advanced-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bigquery_advanced_utils-0.0.1.dev3.tar.gz -
Subject digest:
c3c12a81bb2b6b57a02e71c81ed708e69707d70ab37f5a3ec530f1a4f0befde0 - Sigstore transparency entry: 153946316
- Sigstore integration time:
-
Permalink:
Alessio-Siciliano/bigquery-advanced-utils@da58c1c4f9b4c9cd09780ede7a3bb0eb6c0b847c -
Branch / Tag:
refs/tags/v0.0.1.dev3 - Owner: https://github.com/Alessio-Siciliano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@da58c1c4f9b4c9cd09780ede7a3bb0eb6c0b847c -
Trigger Event:
push
-
Statement type:
File details
Details for the file bigquery_advanced_utils-0.0.1.dev3-py3-none-any.whl.
File metadata
- Download URL: bigquery_advanced_utils-0.0.1.dev3-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a77215514e77733660aed991e8bf3c8bda0d61eaecf3ad14963e451e94b87feb
|
|
| MD5 |
bf1259724889c7d0d187c34b9d98bf4b
|
|
| BLAKE2b-256 |
656c5537b79fdc7da666b4576be1cb36e0dee97b5ceef5cf3e82dd88a9b90cfa
|
Provenance
The following attestation bundles were made for bigquery_advanced_utils-0.0.1.dev3-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Alessio-Siciliano/bigquery-advanced-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bigquery_advanced_utils-0.0.1.dev3-py3-none-any.whl -
Subject digest:
a77215514e77733660aed991e8bf3c8bda0d61eaecf3ad14963e451e94b87feb - Sigstore transparency entry: 153946317
- Sigstore integration time:
-
Permalink:
Alessio-Siciliano/bigquery-advanced-utils@da58c1c4f9b4c9cd09780ede7a3bb0eb6c0b847c -
Branch / Tag:
refs/tags/v0.0.1.dev3 - Owner: https://github.com/Alessio-Siciliano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@da58c1c4f9b4c9cd09780ede7a3bb0eb6c0b847c -
Trigger Event:
push
-
Statement type: