
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
limesurveyrc2api
Advanced tools
This module provides a class which can be used as a client for interacting with LimeSurvey Remote Control 2 API.
From pip:
pip install limesurveyrc2api
or from GitHub, for example using the master branch:
pip install https://github.com/lindsay-stevens/limesurveyrc2api/archive/master.zip
The tests are a good place to refer to for api usage, until proper docs are written, anyway. Here is how to get a list of surveys.
from limesurveyrc2api.limesurvey import LimeSurvey
url = "http://localhost:443/limesurvey/index.php/admin/remotecontrol"
username = "admin"
password = "admin"
# Open a session.
api = LimeSurvey(url=url, username=username)
api.open(password=password)
# Get a list of surveys the admin can see, and print their IDs.
result = api.survey.list_surveys()
for survey in result:
print(survey.get("sid"))
# Close the session.
api.close()
It's just a start, so the list of implemented methods is shorter than not.
Where possible, error messages from the RC2API are translated into Python exceptions (specifically, a LimeSurveyError), with the caller method and error message included in the exception message plus any other relevant info.
# Get a copy of the repository.
mkdir -P ~/repos/limesurveyrc2api
cd ~/repos/limesurveyrc2api
git clone https://github.com/lindsay-stevens/limesurveyrc2api.git repo
# Create and activate a virtual environment for the install.
/usr/local/bin/python3.9 -m venv venv
source venv/bin/activate
# Install limesurveyrc2api, and it's development dependencies.
cd ~/repos/limesurveyrc2api/repo
pip install -e .
pip install -r dev_requirements.pip
# Leave the virtualenv.
deactivate
Useful references for the RC2API:
If extending or maintaining this project, be aware that discovering error messages to raise an exception from is a relatively tedious process. It involves reading through the handler script, looking for lines like the following.
return array('status' => 'No permission');
Whether or not the message is an error depends on the context of the line and the message text. For example, some RC2API methods that delete objects return a message that looks like an error but indicate success, e.g. "status": "OK".
python -m unittestpython setup.py testThere is a PHP 5.6.0+ issue where the API response value includes a deprecation warning, which breaks the JSON response parsing. To deal with this, ensure that the following php.ini setting is set: always_populate_raw_post_data = -1.
Project setup for IDEA requires defining a "project SDK", under File -> Project Structure -> Project. Since this is a Python project, the SDK is the interpreter you want to use, which could (should) be a virtual environment interpreter.
Since the SDK setting is user specific, it'll need to be created the first time you load up this project. This should create an entry under Platform Settings -> Global Libraries; and a file /.idea/misc.xml, containing the name of the global library (SDK) selected for this project.
FAQs
LimeSurvey RC2 API Web Services Client
We found that limesurveyrc2api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.