Skip to main content

Torch Data Bigquery

PyPI - Version PyPI - Python Version


Torch Dataset interface for Google BigQuery datasets.

Table of Contents

Installation

pip install torch-data-bigquery

Examples

BigQueryStorageDataset

import torch
from torch_data_bigquery import BigQueryStorageDataset

dataset = BigQueryStorageDataset(
    billing_project=PROJECT,
    selected_fields=[
        "PassengerId",
        "Survived",
        "Pclass",
    ],
    location=f"bq://your-gcp-project.kaggle_titanic.train",
)

dataloader = torch.utils.data.DataLoader(dataset)

BigQueryDataset

import torch
from torch_data_bigquery import BigQueryDataset

dataset = BigQueryDataset(
    billing_project=PROJECT,
    query=f"""
        SELECT
            Survived                                AS survived,    # 1
            Pclass                                  AS pclass,      # 2
            DENSE_RANK() OVER(ORDER by Sex)         AS sex,         # 3   
            COALESCE(Age, AVG(Age) OVER())          AS age,         # 4
            SibSp                                   AS siblings,    # 5
            Parch                                   AS parents,     # 6
            Fare                                    AS fare,        # 7
            DENSE_RANK() OVER(ORDER by Embarked)    AS embarked,    # 8
        FROM `your-gcp-project.kaggle_titanic.train`
    """,
)

dataloader = torch.utils.data.DataLoader(dataset)

License

torch-data-bigquery is distributed under the terms of the MIT license.

Metadata

Release files for torch-data-bigquery 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-data-bigquery 0.0.2
File Size Uploaded
torch_data_bigquery-0.0.2.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-data-bigquery 0.0.2
File Interpreter ABI Platform
torch_data_bigquery-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / torch_data_bigquery-0.0.2.tar.gz

Download URL torch_data_bigquery-0.0.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6f8fef2fea653bb82843faf2c49a2584505945862a077e73646079234042c526
BLAKE2b-256 checksum
How to use checksums
c40039b9057e3b56164923fec11397a97e88760771c01d69c35c5d76114daba7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.26.0

Release files / torch_data_bigquery-0.0.2-py3-none-any.whl

Download URL torch_data_bigquery-0.0.2-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c830e13280c0879241326cb76d1607588b9c40f9fb77b3124111a18be13757d
BLAKE2b-256 checksum
How to use checksums
44661e3bc6e3268e91f19fefb58de4682630f14f2cb3558f9cc25d0658d8b95a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.26.0

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page