Web API

urlib

urllib.request

Request(<link>)

request object

  • add_header
    • add HTTP header - to be like a browser
    • pass in data (bytes format) - POST a request
  • getheaders

request.

  • urlopen - context object

handler

urlib.request.ProxyHandler

ProxyBasicAuthHandler

requests

  • get(<url>, params)
    • returns a webpage object
  • post(<url>, data)
  • put
  • delete

web object

  • status_code
  • text
  • url
  • encoding
    • utf-8
>>> r = requests.get('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%202151330&format=json')
>>> r.json()
{'query': {'count': 1, 'created': '2017-11-17T07:14:12Z', ...

Beautiful Soup

HDF5


Database

sqlite3

  • connect(<sqlite file>) - returns connection
  • connections
    • execute - returns cursor
    • executemany
    • commit()
  • cursor
    • fetchall
      • display the data
    • description

sqlalchemy

sqla

  • create_engine()

results matching ""

    No results matching ""