Skip to main content

Generate BigQuery tables, load and extract data, based on JSON Table Schema descriptors.

Project description

Travis
Coveralls
PyPi
SemVer
Gitter

Generate and load BigQuery tables based on JSON Table Schema descriptors.

Version v0.3 contains breaking changes:

  • renamed Storage.tables to Storage.buckets

  • changed Storage.read to read into memory

  • added Storage.iter to yield row by row

Getting Started

Installation

pip install jsontableschema-bigquery

Storage

Package implements Tabular Storage interface.

To start using Google BigQuery service:

  • Create a new project - link

  • Create a service key - link

  • Download json credentials and set GOOGLE_APPLICATION_CREDENTIALS environment variable

We can get storage this way:

import io
import os
import json
from apiclient.discovery import build
from oauth2client.client import GoogleCredentials
from jsontableschema_bigquery import Storage

os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '.credentials.json'
credentials = GoogleCredentials.get_application_default()
service = build('bigquery', 'v2', credentials=credentials)
project = json.load(io.open('.credentials.json', encoding='utf-8'))['project_id']
storage = Storage(service, project, 'dataset', prefix='prefix')

Then we could interact with storage:

storage.buckets
storage.create('bucket', descriptor)
storage.delete('bucket')
storage.describe('bucket') # return descriptor
storage.iter('bucket') # yields rows
storage.read('bucket') # return rows
storage.write('bucket', rows)

Mappings

schema.json -> bigquery table schema
data.csv -> bigquery talbe data

Drivers

Default Google BigQuery client is used - docs.

API Reference

Snapshot

https://github.com/frictionlessdata/jsontableschema-py#snapshot

Detailed

Contributing

Please read the contribution guideline:

How to Contribute

Thanks!

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

jsontableschema-bigquery-0.4.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsontableschema_bigquery-0.4.3-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jsontableschema-bigquery-0.4.3.tar.gz.

File metadata

File hashes

Hashes for jsontableschema-bigquery-0.4.3.tar.gz
Algorithm Hash digest
SHA256 6c39c30a583d17579516772a292309193cb7fe0909f15533d4e77a863b4d247b
MD5 1450627939c2b330f4943f0f6c96b7a2
BLAKE2b-256 bff874ef255e79eb44d2ee1a1632260673b0ed6a21ed99a9912dc7f4de30a54a

See more details on using hashes here.

File details

Details for the file jsontableschema_bigquery-0.4.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jsontableschema_bigquery-0.4.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f00e88791284f37d6cd9d3c801522cc44cc8904d40bf13d3de726705a58273a3
MD5 19fed5e7080f59d63c65af74113426ef
BLAKE2b-256 ba523d6cbc4c9661f7a4c044efa67e7028c38d9c4d00a0bc5ba3403d9b6fd8f6

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