Skip to main content

Easily integrate data in BigQuery

Project description

PyGBQ

Easily integrate data in BigQuery

Example

The following snippet

from pygbq import Client
import requests
client = Client(default_dataset='Finance')

@client.gbq(how='replace')
def transactions(start_date):
    data = requests.get(url='some/api/endpoint', headers={'start_date': start_date}).json()
    return data

if __name__ == "__main__":
    transactions("2020-11-25")

will (re)create table Finance.transactions in your default project.

Install and set up

pip install pygbq

Set up the authentication.

Documentation

  • gbq - main decorator
  • update_table_using_temp - if you want to use the decorator as a function
  • table - friendly interface to get a table from BigQuery
  • set_dataset - set default dataset in the project
  • MyError - if you need to return a value with Flask
  • read_jsonl - read newline delimited json
  • generate_schema - might be useful for the first integration when you want to see schema
  • get_secret - get a secret version from Secret Manager
  • add_secret - add a secret version to Secret Manager

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

pygbq-0.21.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

pygbq-0.21-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file pygbq-0.21.tar.gz.

File metadata

  • Download URL: pygbq-0.21.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for pygbq-0.21.tar.gz
Algorithm Hash digest
SHA256 01fcaadc622ef9b1fef64a488e9099f2d306eaafdc97ec329f4ebd4fdb3e1bde
MD5 77380b85dae706914e3de5abc1ffae64
BLAKE2b-256 4a52e12e1d8e8a7ae48336e232279ea440ead24e8b16d48c1b178e3e73c5dfe9

See more details on using hashes here.

File details

Details for the file pygbq-0.21-py3-none-any.whl.

File metadata

  • Download URL: pygbq-0.21-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for pygbq-0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 3c567248e0386322952950f5476816e6948cb38d14caa11f736004069ca33ab3
MD5 fd3296092988fad3bfc349f512fb03c2
BLAKE2b-256 1b963898332b9b8535d12586ffd999ff1bb12068db4a7a86b0308ba2f6b8ab51

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