A customizable survey web user interface.
You can install surveyengine via
pip install --user surveyengine
and run it via:
python -m surveyengine spec.json output/
Where output is the output folder for the results and spec.json is a survey specification:
{
"title": "Survey Title Here", // the survey title
"pages": [ // a sequence of pages
{
"lines": [
"first line", // plain text that will be displayed
"second line {foo}" // displays: second line bar
],
"vars": { // defines local variables
"foo": "bar"
},
"pid": "start" // the id for the page (used as prefix in the result file)
"continue": "next", // creates a single button at the bottom -- default ("next") can be omitted
"type": "plain" // the type of page -- default ("plain") can be omitted
}, {
"type": "each", // repeats a sequence of pages
"name": "ix", // the iteration variable name -- it can be used via {ix} in fields
"name_next": "ix_next", // "name_next" and "name_prev" are optional variables containing the next / previous iteration
"vars": { // defines local variables
"img_len": 25 // we define the range as variable so we can use it in the text
},
"to": "{img_len}", // iterate until this number
"pages": [
// ... pages to repeat ...
{
"lines": [
"image {ix_next} / {img_len}", // displays: image 1 / 25
[ "img", "path/to/image{ix}.png", "" ] // the image to display
],
"pid": "question:{ix}" // the id for the page
"continue": "choice", // creates a collection of buttons at the bottom
"values": [ // the values to choose from
"yes",
"no"
]
}
]
// this page type does not have a "continue" field
}, {
"lines": [
// other special lines
// [ question_type, display_text, question_id ]
[ "text", "just text", "" ], // simple text -- equivalent to "just text"
[ "likert", "fun", "fun" ], // likert scale
[ "likert", "confidence", "conf" ]
],
"pid": "specials"
}, {
"lines": [
"Thanks! {_token}" // _token is a special variable containing the user id
],
"continue": "end", // indicates the end of the survey -- this page must exist
"pid": "end"
}
]
}
Each user creates a result file with its unique token in the output folder. The result file is a JSON file containing all answers.
Release files for surveyengine 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| surveyengine-0.0.3.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| surveyengine-0.0.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / surveyengine-0.0.3.tar.gz
| Download URL | surveyengine-0.0.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1e60e3a5947cfe6ab2c28c3e29c476d9a7fef385b3fc564c5d86a6df7327d64
|
|
BLAKE2b-256 checksum How to use checksums |
9d644f49732d3ac325ec65c63876a281c4c517b1e9b93b3b4b94f924d743e00b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / surveyengine-0.0.3-py2.py3-none-any.whl
| Download URL | surveyengine-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a67fb5d88f9cbfbc521bb7b9ed14f50421f20e5cd8f7d025e4b16386ca821f93
|
|
BLAKE2b-256 checksum How to use checksums |
2e250c604013f67d9e1f84ab03b6225d3b89522b271c3e2adb84cc2ad55da4b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |