from sqlalchemy import create_engine
import sys, os
import pandas as pd

constr = 'mysql+pymysql://{user}:{pwd}@{host}'.format(user=os.environ['MYSQL_USERNAME'],
                                                      pwd=os.environ['MYSQL_PASSWORD'],
                                                      host=os.environ['MYSQL_HOST'])
con = create_engine(constr)
df = pd.read_sql('select * from enwiki_p.page limit 10', con)
df
page_id page_namespace page_title page_restrictions page_is_redirect page_is_new page_random page_touched page_links_updated page_latest page_len page_content_model page_lang
0 10 0 b'AccessibleComputing' b'' 1 0 0.331671 b'20191003224230' b'20190105021557' 854851586 94 b'wikitext' None
1 12 0 b'Anarchism' b'' 0 0 0.786172 b'20191109030747' b'20191109030901' 925150118 104687 b'wikitext' None
2 13 0 b'AfghanistanHistory' b'' 1 0 0.062150 b'20191029091312' b'20190618192734' 783865149 90 b'wikitext' None
3 14 0 b'AfghanistanGeography' b'' 1 0 0.952234 b'20191016144702' b'20190618192734' 783865160 92 b'wikitext' None
4 15 0 b'AfghanistanPeople' b'' 1 0 0.574721 b'20191104232438' b'20190618192734' 783865293 95 b'wikitext' None
5 18 0 b'AfghanistanCommunications' b'' 1 0 0.751068 b'20190916234018' b'20190618192734' 783865299 97 b'wikitext' None
6 19 0 b'AfghanistanTransportations' b'' 1 0 0.674273 b'20190926165308' b'20190618192735' 783821589 113 b'wikitext' None
7 20 0 b'AfghanistanMilitary' b'' 1 0 0.118158 b'20191015052253' b'20190618192735' 783821738 88 b'wikitext' None
8 21 0 b'AfghanistanTransnationalIssues' b'' 1 0 0.567973 b'20191029174151' b'20190618192735' 783821743 101 b'wikitext' None
9 23 0 b'AssistiveTechnology' b'' 1 0 0.723041 b'20191101053211' b'20190618192735' 783865310 88 b'wikitext' None