Skip to content

Commit 05ea0db

Browse files
committed
Simplify API
Providing all the top-level methods in the bigquery module, and updated the README.
1 parent bc5c5eb commit 05ea0db

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This client provides an API for retrieving and inserting BigQuery data by wrappi
1212
# Basic Usage
1313

1414
```python
15-
from bigquery.client import get_client
15+
from bigquery import get_client
1616

1717
# BigQuery project id as listed in the Google Developers Console.
1818
project_id = 'project_id'
@@ -180,7 +180,9 @@ client.patch_dataset('mydataset', friendly_name="mon Dataset") # friendly_name c
180180

181181
# Creating a schema from a sample record
182182
```python
183-
client.schema_from_record({id:123, posts: [{id:123, text: "tihs is a post"}], username: "bob"})
183+
from bigquery import schema_from_record
184+
185+
schema_from_record({id:123, posts: [{id:123, text: "tihs is a post"}], username: "bob"})
184186
```
185187

186188
# Caveats

bigquery/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
import logging
2+
23
logging.basicConfig()
34

45
logger = logging.getLogger('bigquery')
56
logger.setLevel(logging.DEBUG)
7+
8+
from client import get_client
9+
from client import (BIGQUERY_SCOPE,
10+
BIGQUERY_SCOPE_READ_ONLY,
11+
JOB_CREATE_IF_NEEDED,
12+
JOB_CREATE_NEVER,
13+
JOB_SOURCE_FORMAT_NEWLINE_DELIMITED_JSON,
14+
JOB_SOURCE_FORMAT_DATASTORE_BACKUP,
15+
JOB_SOURCE_FORMAT_CSV,
16+
JOB_WRITE_TRUNCATE,
17+
JOB_WRITE_APPEND,
18+
JOB_WRITE_EMPTY,
19+
JOB_ENCODING_UTF_8,
20+
JOB_ENCODING_ISO_8859_1)
21+
22+
from schema_builder import schema_from_record

0 commit comments

Comments
 (0)