2

Got an interesting error that could very easily be user problem.

I'm trying to access an API used by the Washington Public Disclosure Commission. It uses Socrata and because I'm using Python I'm using the sodapy package.

The error first:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //data.wa.gov/resource/dgis-xpmb.json?%24limit=2000 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f9da657d110>: Failed to establish a new connection: [Errno -2] Name or service not known',))

Here's the code, which is almost a carbon copy of the Code Snippet listed on the docs.

import pandas as pd
from sodapy import Socrata

MyAppToken = "###############"

client = Socrata("https://data.wa.gov", 
    MyAppToken, 
    username="########@######.###", 
    password="##############")

results = client.get("dgis-xpmb", limit=2000)

results_df = pd.DataFrame.from_records(result_list)

In my own experimentation I've taken off the bottom line but the error stays the same, because the error gets caught at the client.get command.

I know it's not the server's problem because using curl -i, Chrome and Postman can all get the pertinent data no problem.

The token I'm using is also registered with Socrata so that should feasibly be OK.

I've tried running the python in Python 2.7.6 and 3.4.3 with the required packages. Still no go.

Any help appreciated.

elyorte
  • 21
  • 2

0 Answers0