Skip to content

Commit 406b540

Browse files
committed
added readme and setup.py
1 parent e5cff3e commit 406b540

3 files changed

Lines changed: 65 additions & 4 deletions

File tree

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@
77
![PyMySQL](https://img.shields.io/badge/PyMySQL-v0.9.3-red.svg?longCache=true&style=flat-square&logo=mysql&logoColor=white&colorA=4c566a&colorB=bf616a)
88
![Psycopg2-Binary](https://img.shields.io/badge/Psycopg2--Binary-v2.8.4-red.svg?longCache=true&style=flat-square&logo=postgresql&logoColor=white&colorA=4c566a&colorB=bf616a)
99
![GitHub Last Commit](https://img.shields.io/github/last-commit/google/skia.svg?style=flat-square&colorA=4c566a&colorB=a3be8c)
10-
[![GitHub Issues](https://img.shields.io/github/issues/toddbirchard/bigquery-to-sql.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/hackersandslackers/bigquery-python-tutorial/issues)
11-
[![GitHub Stars](https://img.shields.io/github/stars/toddbirchard/bigquery-to-sql.svg?style=flat-square&colorB=ebcb8b&colorA=4c566a)](https://github.com/hackersandslackers/bigquery-python-tutorial/stargazers)
12-
[![GitHub Forks](https://img.shields.io/github/forks/toddbirchard/bigquery-to-sql.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/hackersandslackers/bigquery-python-tutorial/network)
10+
[![GitHub Issues](https://img.shields.io/github/issues/hackersandslackers/bigquery-sqlalchemy-tutorial.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/hackersandslackers/bigquery-python-tutorial/issues)
11+
[![GitHub Stars](https://img.shields.io/github/stars/hackersandslackers/bigquery-sqlalchemy-tutorial.svg?style=flat-square&colorB=ebcb8b&colorA=4c566a)](https://github.com/hackersandslackers/bigquery-python-tutorial/stargazers)
12+
[![GitHub Forks](https://img.shields.io/github/forks/hackersandslackers/bigquery-sqlalchemy-tutorial.svg?style=flat-square&colorA=4c566a&colorB=ebcb8b)](https://github.com/hackersandslackers/bigquery-python-tutorial/network)
1313

14-
Lightweight ETL script to migrate data from BigQuery to SQL database, and vice versa.
14+
![BigQuery SQLAlchemy Tutorial](https://res-5.cloudinary.com/hackers/image/upload/q_auto:best/v1/2019/11/bigquery-sql.jpg)
15+
16+
Lightweight ETL script to migrate data from BigQuery to SQL databases, or vice versa.
17+
18+
## Getting Started
19+
20+
Installation is recommended with [Pipenv](https://pipenv-fork.readthedocs.io/en/latest/):
21+
22+
```shell
23+
$ git clone https://github.com/hackersandslackers/bigquery-python-tutorial.git
24+
$ cd bigquery-python-tutorial
25+
$ pipenv shell
26+
$ pipenv update
27+
$ python3 main.py
28+
```

setup.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""A setuptools based setup module."""
2+
from os import path
3+
from setuptools import setup, find_packages
4+
from io import open
5+
6+
here = path.abspath(path.dirname(__file__))
7+
8+
# Get the long description from the README file
9+
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
10+
long_description = f.read()
11+
12+
setup(
13+
name='bigquery-sqlalchemy-tutorial',
14+
version='1.0.0',
15+
description='ETL script to migrate data from BigQuery to SQL.',
16+
long_description=long_description,
17+
long_description_content_type='text/markdown',
18+
url='https://github.com/hackersandslackers/bigquery-sqlalchemy-tutorial',
19+
author='Todd Birchard',
20+
author_email='toddbirchard@gmail.com',
21+
classifiers=[
22+
'Development Status :: 3 - Alpha',
23+
'Intended Audience :: Developers',
24+
'Programming Language :: Python :: 3.7',
25+
],
26+
keywords='SQLAlchemy Google BigQuery SQL ETL',
27+
packages=find_packages(), # Required
28+
install_requires=['SQLAlchemy',
29+
'PyBigQuery',
30+
'PyMySQL',
31+
'Psycopg2-Binary'],
32+
extras_require={
33+
'dev': ['check-manifest'],
34+
'test': ['coverage'],
35+
'env': ['python-dotenv']
36+
},
37+
entry_points={
38+
'console_scripts': [
39+
'run = __main__',
40+
],
41+
},
42+
project_urls={
43+
'Bug Reports': 'https://github.com/hackersandslackers/bigquery-sqlalchemy-tutorial/issues',
44+
'Source': 'https://github.com/hackersandslackers/bigquery-sqlalchemy-tutorial/',
45+
},
46+
)

src/sources/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def fetch_rows(self, query):
2929
return rows
3030

3131
def __construct_response(self, rows):
32+
"""Summarize results of an executed query."""
3233
columns = rows[0].keys()
3334
column_names = ", ".join(columns)
3435
num_rows = len(rows)

0 commit comments

Comments
 (0)