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
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
pygbq-0.22.tar.gz
(9.4 kB
view details)
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
pygbq-0.22-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file pygbq-0.22.tar.gz.
File metadata
- Download URL: pygbq-0.22.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62a28d5451af49191f0e0a5ee87e37f26a51738828e404808e51c00edca38240
|
|
| MD5 |
a8d5fb5c2450a0daa2bca21a19403d04
|
|
| BLAKE2b-256 |
64864b2137471f9aa20039197326e959a4dc325f4c9779592e7dbb391eef1d92
|
File details
Details for the file pygbq-0.22-py3-none-any.whl.
File metadata
- Download URL: pygbq-0.22-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5e3c189db1159492f4c698b1558dee9100b412a8f9295b479e3c1e26bf04e78
|
|
| MD5 |
de0e373f37b53fcb42599dd41b7c737a
|
|
| BLAKE2b-256 |
1c84ee36756bcc5f0fa455653bbab3b2119ec0f991c89b32d5897371c948c809
|