Skip to content

Commit

Permalink
[#16] renamed module to jsontableschema_bigquery
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Mar 5, 2016
1 parent 6d5f005 commit 15f1593
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ import os
import json
from apiclient.discovery import build
from oauth2client.client import GoogleCredentials
from jsontableschema_bigquery import Storage

os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '.credentials.json'
credentials = GoogleCredentials.get_application_default()
service = build('bigquery', 'v2', credentials=credentials)
project = json.load(io.open('.credentials.json', encoding='utf-8'))['project_id']
storage = jtsbq.Storage(service, project, 'dataset', prefix='prefix')
storage = Storage(service, project, 'dataset', prefix='prefix')
```

Then we could interact with storage:
Expand Down Expand Up @@ -56,7 +57,7 @@ Default Google BigQuery client is used - [docs](https://developers.google.com/re
## Documentation

API documentation is presented as docstings:
- [Storage](https://github.com/okfn/jsontableschema-bigquery-py/blob/master/jtsbq/storage.py)
- [Storage](https://github.com/okfn/jsontableschema-bigquery-py/blob/master/jsontableschema_bigquery/storage.py)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions examples/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from oauth2client.client import GoogleCredentials

sys.path.insert(0, '.')
import jtsbq
from jsontableschema_bigquery import Storage


def run(dataset, prefix, table, schema, data):
Expand All @@ -22,7 +22,7 @@ def run(dataset, prefix, table, schema, data):
credentials = GoogleCredentials.get_application_default()
service = build('bigquery', 'v2', credentials=credentials)
project = json.load(io.open('.credentials.json', encoding='utf-8'))['project_id']
storage = jtsbq.Storage(service, project, dataset, prefix=prefix)
storage = Storage(service, project, dataset, prefix=prefix)

# Check table
if storage.check(table):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def read(*paths):


# Prepare
PACKAGE = 'jtsbq'
PACKAGE = 'jsontableschema_bigquery'
INSTALL_REQUIRES = [
'six>=1.9',
'unicodecsv',
Expand Down
2 changes: 1 addition & 1 deletion tests/module/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import unittest
from mock import MagicMock, patch, ANY
from importlib import import_module
module = import_module('jtsbq.storage')
module = import_module('jsontableschema_bigquery.storage')


class TestStorage(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
package=jtsbq
package=jsontableschema_bigquery
skip_missing_interpreters=true
envlist=
py27
Expand Down

0 comments on commit 15f1593

Please sign in to comment.