Skip to content

Commit 4e2db02

Browse files
committed
Refactor.
1 parent af9f124 commit 4e2db02

14 files changed

Lines changed: 1061 additions & 131 deletions

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/bigquery-python-tutorial.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pipfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ name = "pypi"
33
url = "https://pypi.org/simple"
44
verify_ssl = true
55

6-
[dev-packages]
7-
86
[packages]
97
google-cloud-storage = "*"
108
google-cloud-bigquery = "*"
11-
pprint = "*"
9+
loguru = "*"
10+
11+
[dev-packages]
12+
pytest = "*"
1213

1314
[requires]
14-
python_version = "3.7"
15+
python_version = "3.8"

Pipfile.lock

Lines changed: 215 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,49 @@
11
# Google Big Query: Python SDK Tutorial
22

33

4-
![Python](https://img.shields.io/badge/Python-v3.7-blue.svg?logo=python&longCache=true&logoColor=white&style=flat-square&colorA=4c566a&colorB=5e81ac)
4+
![Python](https://img.shields.io/badge/Python-v3.8-blue.svg?logo=python&longCache=true&logoColor=white&style=flat-square&colorA=4c566a&colorB=5e81ac)
55
![Google Cloud BigQuery](https://img.shields.io/badge/Google--BigQuery-v1.11.2-blue.svg?logo=Google&longCache=true&logoColor=white&style=flat-square&colorA=4c566a&colorB=5e81ac)
66
![Google Cloud Storage](https://img.shields.io/badge/Google--Cloud--Storage-v1.15.0-blue.svg?logo=Google&longCache=true&logoColor=white&style=flat-square&colorA=4c566a&colorB=5e81ac)
77
![GitHub Last Commit](https://img.shields.io/github/last-commit/google/skia.svg?style=flat-square&colorA=4c566a&colorB=a3be8c)
88
[![GitHub Issues](https://img.shields.io/github/issues/toddbirchard/tableau-extraction.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/hackersandslackers/bigquery-python-tutorial/issues)
99
[![GitHub Stars](https://img.shields.io/github/stars/toddbirchard/tableau-extraction.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/hackersandslackers/bigquery-python-tutorial/stargazers)
1010
[![GitHub Forks](https://img.shields.io/github/forks/toddbirchard/tableau-extraction.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/hackersandslackers/bigquery-python-tutorial/network)
1111

12-
1312
Source for the accompanying tutorial: https://hackersandslackers.com/google-bigquery-python/
13+
14+
## Installation
15+
16+
**Installation via `requirements.txt`**:
17+
18+
```shell
19+
$ git clone https://github.com/hackersandslackers/bigquery-python-tutorial.git
20+
$ cd bigquery-python-tutorial
21+
$ python3 -m venv myenv
22+
$ source myenv/bin/activate
23+
$ pip3 install -r requirements.txt
24+
$ python3 main.py
25+
```
26+
27+
**Installation via [Pipenv](https://pipenv-fork.readthedocs.io/en/latest/)**:
28+
29+
```shell
30+
$ git clone https://github.com/hackersandslackers/bigquery-python-tutorial.git
31+
$ cd bigquery-python-tutorial
32+
$ pipenv shell
33+
$ pipenv update
34+
$ python3 main.py
35+
```
36+
37+
**Installation via [Poetry](https://python-poetry.org/)**:
38+
39+
```shell
40+
$ git clone https://github.com/hackersandslackers/bigquery-python-tutorial.git
41+
$ cd bigquery-python-tutorial
42+
$ poetry shell
43+
$ poetry update
44+
$ python3 main.py
45+
```
46+
47+
-----
48+
49+
**Hackers and Slackers** tutorials are free of charge. If you found this tutorial helpful, a [small donation](https://www.buymeacoffee.com/hackersslackers) would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content.

config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44

55
# Google Cloud Storage
6-
bucketURI = environ.get('GCP_BUCKET_URI')
7-
bucketName = environ.get('GCP_BUCKET_NAME')
6+
bucket_uri = environ.get('GCP_BUCKET_URI')
7+
bucket_name = environ.get('GCP_BUCKET_NAME')
88

99
# Google BigQuery
10-
bigqueryDataset = environ.get('GCP_BIGQUERY_DATASET')
11-
bigqueryTable = environ.get('GCP_BIGQUERY_TABLE')
10+
bigquery_dataset = environ.get('GCP_BIGQUERY_DATASET')
11+
bigquery_table = environ.get('GCP_BIGQUERY_TABLE')
1212

1313
# Data
14-
localDataFile = environ.get('LOCAL_DATA_TARGET')
15-
destinationBlobName = environ.get('DESTINATION_BLOB_NAME')
14+
local_data_csv = environ.get('LOCAL_DATA_TARGET')
15+
destination_blob = environ.get('DESTINATION_BLOB_NAME')

0 commit comments

Comments
 (0)