Skip to main content

Interactive Command Line Interface for Google BigQuery

Project description

bq_loader - Interactive Command Line Interface for Google BigQuery

PyPI - Downloads License PyPI - Version PyPI - Python Version

Install

pip install bq_loader

Authentication

This package is built on top of Google libraries. To use this package you need to authenticate with your google account. For more information see: https://cloud.google.com/storage/docs/authentication.

You can use the package gcloud to authenticate yourself.

gcloud auth

Usage

Command Line Interface

bqloader

Demo

API

Create a table from a local file or directory

from bq_loader import create_table_from_local

 create_table_from_local(table_id='snapshot',
                         project_id='subugoe-collaborative',
                         dataset_id='resources',
                         file_path='test_data/*',
                         schema_file_path='test_schema/schema_crossref.json',
                         source_format='jsonl',
                         write_disposition='WRITE_APPEND',
                         table_description='Test Table generated by bq_loader',
                         ignore_unknown_values=True)

Create a table from a Google Bucket

from bq_loader import create_table_from_bucket

create_table_from_bucket(uri='gs://bigschol/tests/*',
                         table_id='bq_loader_test',
                         project_id='subugoe-collaborative',
                         dataset_id='resources',
                         schema_file_path='test_schema/schema_crossref.json',
                         source_format='jsonl',
                         write_disposition='WRITE_EMPTY',
                         table_description='Test Table generated by bq_loader',
                         ignore_unknown_values=True)

Upload local files to a Google Bucket

from bq_loader import upload_files_to_bucket

upload_files_to_bucket(bucket_name='bigschol',
                       file_path='test_data/*',
                       gcb_dir='tests')

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

bq_loader-0.1.7.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file bq_loader-0.1.7.tar.gz.

File metadata

  • Download URL: bq_loader-0.1.7.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for bq_loader-0.1.7.tar.gz
Algorithm Hash digest
SHA256 46ce29a98c231ffa22ac234cb8998a469f8475d78f7f2f263e0f2630179fb8e3
MD5 f8d2f574ec1359f2c690a6f7704a05ac
BLAKE2b-256 76f7558cfdaeec04dea5c764efa8fb4cd332970d6f05fadc9068d109660a14fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page