Guest User

Untitled

a guest
Mar 29th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. from sqlalchemy import create_engine
  2. import pandas pd
  3.  
  4. def _get_hm_eng():
  5. """Return the engine for the HM db"""
  6. hm_db_type = 'postgresql'
  7. hm_user = ''
  8. hm_pass = ''
  9. hm_address = ''
  10. return create_engine('{}://{}:{}@{}'.format(hm_db_type,
  11. hm_user,
  12. hm_pass,
  13. hm_address))
  14.  
  15. eng = _get_hm_eng()
  16. df = pd.read_sql_query(qry, eng)
Add Comment
Please, Sign In to add comment