LiquidPlanner Classic Forum
API & Python
over 5 years ago by LiquidPlanner Support(edited)
Posted on behalf of Tom Idstein. Original posting date 2014-01-24
Hello,
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.
SOURCE::
from liquidplanner import LiquidPlanner
import requests #version 2.2.0
import json
import getpass
LiquidPlanner.demo()
RESPONSE::
Add a task? (Y for yes): n
Traceback (most recent call last):
File "C:\Python33\_LEARNING\LP_Test.py", line 6, in <module>
LiquidPlanner.demo()
File "C:\Python33\lib\liquidplanner.py", line 90, in demo
workspace = LP.workspaces()[0]
File "C:\Python33\lib\liquidplanner.py", line 60, in workspaces
return json.loads(self.get('/workspaces').content)
File "C:\Python33\lib\json\__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "C:\Python33\lib\json\decoder.py", 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.