Skip to main content

bqlib - BigQuery Python Library

BigQuery Python Library

See: Google BigQuery

Requirements

  • Python 2.6 or later (not support for 3.x)

Setup

$ pip install bqlib

How to use

Single Query - BQJob

BQJob is a class for starting the BigQuery job and fetching the result.
You can use either run_sync(synchronous) or run_async(asynchronous) method.
from bqlib import BQJob

project_id = 'example_project'
query = 'SELECT foo FROM bar'
http = authorized_http

bqjob = BQJob(http, project_id, query=query)

# run synchronously
job_result = bqjob.run_sync()

# or run asynchronously
bqjob.run_async()
# ... do other things ...

job_result = bqjob.get_result()

print job_result # [{u'foo': 10}, {u'foo': 20}, ...]

Multiple Queries - BQJobGroup

BQJobGroup is a class for putting multiple BQJobs into an one group.
Each BQJob in that group are executed concurrently.
from bqlib import BQJob, BQJobGroup

bqjob1 = BQJob(http, project_id, query=query)
bqjob2 = BQJob(http, project_id, query=query)

job_group = BQJobGroup([bqjob1, bqjob2])
# synchronously
results = job_group.run_sync()

# or asynchronously
job_group.run_async()
# ... do other things ...

results = job_group.get_results()

print results # [[{'foo': 10}, {'foo': 20}], [{'bar': 'test'}]]

Note

  • Concurrent Requests to BigQUery
    • Concurrent requests to BigQuery is restricted to 20 requests by Quota Policy.

    • If you want to set up concurrent requests to 20, you also have to set up at traffic controls in api-console page.

License

This library is disributed as MIT license.

History

2013-10-22 bqlib 0.0.1

  • First release

2014-03-18 bqlib 0.0.2

  • Bug fixes

Metadata

Release files for bqlib 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 bqlib 0.0.2
File Size Uploaded Provenance
bqlib-0.0.2.tar.gz 5.5 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for bqlib 0.0.2
File Interpreter ABI Platform
bqlib-0.0.2.macosx-10.9-intel.tar.gz Details
bqlib-0.0.2-py2.7.egg Legacy Egg format - - Details

Total release size: 26.1 kB

Release files / bqlib-0.0.2.tar.gz

Download URL bqlib-0.0.2.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0ee164c2c9572b4c48f65c94085e5ded24e5bc85d57bcfa004057e11c348b3e7
BLAKE2b-256 checksum
How to use checksums
61fd2cd54a05f5e951ca65d4bc03ed7a0e30a3b5d0cf0f05d9bd2341bf4ff9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / bqlib-0.0.2.macosx-10.9-intel.tar.gz

Download URL bqlib-0.0.2.macosx-10.9-intel.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
637372b7f7a9a2ce7e673952d762c7b362e8125d86900433cea8f52fbd690823
BLAKE2b-256 checksum
How to use checksums
750ed9b76bec4a08609be2437f333ad2f8fa9fbe649ef0040b47a8c1c00ad5d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / bqlib-0.0.2-py2.7.egg

Download URL bqlib-0.0.2-py2.7.egg
Size 11.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
bf09629506669271e4ee532f01ab7172ecea9e0c390608bb68ff314ca8bc9b26
BLAKE2b-256 checksum
How to use checksums
b5f5d3f9a4450dd95099a5cb2ba0b3b3d285b6b9e2ade91d705e4a24ab85cd41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for bqlib 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.2 This release

3 release files No provenance

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