LiquidPlanner Classic Forum

Ask a Question
Back to All

API & Python


Posted on behalf of Tom Idstein. Original posting date 2014-01-24


I am attempting to use the sample API Python Code to access my workspace and make changes. I started by simply trying to use the LP.demo() example script, but I am receiving an error in return.

I am using Python 3.3.3 as well as requests 2.2.


from liquidplanner import LiquidPlanner
import requests #version 2.2.0
import json
import getpass



Add a task? (Y for yes): n
Traceback (most recent call last):
File "C:\Python33\_LEARNING\", line 6, in <module>
File "C:\Python33\lib\", line 90, in demo
workspace = LP.workspaces()[0]
File "C:\Python33\lib\", line 60, in workspaces
return json.loads(self.get('/workspaces').content)
File "C:\Python33\lib\json\", line 319, in loads
return _default_decoder.decode(s)
File "C:\Python33\lib\json\", line 352, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: can't use a string pattern on a bytes-like object

Please let me know how I can resolve this issue, which seems to reside in the json.loads() portion of the code.

Thank you in advance.