Skip to content

jmcarp/pybigquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DB-API interface and SQLAlchemy dialect for BigQuery. Inspired by PyHive.

Usage

DB-API

import bigquery
cursor = bigquery.connect('project').cursor()
cursor.execute('SELECT * FROM dataset.table LIMIT 10')
print(cursor.fetchone())
print(cursor.fetchall())

SQLAlchemy

from sqlalchemy import *
from sqlalchemy.engine import create_engine
from sqlalchemy.schema import *
engine = create_engine('bigquery://project')
logs = Table('dataset.table', MetaData(bind=engine), autoload=True)
print select([func.count('*')], from_obj=logs).scalar()

Requirements

Install using

  • pip install git+https://github.com/mxmzdlv/pybigquery.git@master#egg=pybigquery

TODO

  • Support for Record column type
  • Add a test suite

About

SQLAlchemy dialect for BigQuery

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.6%
  • Shell 2.4%