petervizi/python-eeml

URL String error check not compatible with new Pachube API URL specification.

Closed this issue · 0 comments

natn commented

The Pachube API documentation states:

"There are currently two versions of the API active. Where possible you should use the most recent version available. We will endeavour to support all versions of the API as far as possible, but the most advanced functionality is unlikely to be backported to previous versions.

Documentation for version 2, base URL: http://api.pachube.com/v2/* (released Aug 2010 - recommended).
Documentation for version 1, base URL: http://api.pachube.com/v1/* (released Feb 2008 - deprecated).
Note: For legacy compatibility, the v1 API will remain available at http://www.pachube.com/api/* but usage should be switched over to use the base URL noted above as soon as possible."

Only the legacy compatibility URL form will pass the URL validation.

Traceback (most recent call last):
File "C:/Users/natn/Documents/Dev/pachube/test.py", line 10, in
pac = eeml.Pachube(API_URL, API_KEY)
File "C:\Python26\lib\eeml\datastream.py", line 31, in init
raise ValueError("The url argument has to be in the form '/api/1275.xml' or 1275")
ValueError: The url argument has to be in the form '/api/1275.xml' or 1275