A DSL for describing questionnaires
Project description
Questionnaire DSL
A DSL for describing questionnaires with a simple terminal interpreter.
Example:
Q: Project type
1[lang]. Language project
2[gen]. Generator project
Q[package]: Package name
___ /[a-z][a-z0-9_]*$/
Q: Author name
___
Q: Author email
___
Q: This question is to
test multiline feature and indenting.
1. Working
2. Not working.
This is also to test multiline in choices.
Each question begins with Q:
or Q[<question ID>]
. The type of the question
is either free-form (specified by ___
) or choice if enumerated options are given.
Both question and option can span multiple lines (like in the last question).
For free-form question an optional regular expression can be given inside //
(see Package name
above). This regex is an input validator.
This package provides an interpreter of the questionnaire
txquestionnaire.questionnaire_interpreter(model, data=None)
which accepts the
model created by parsing of questionnaire description using this language and
optionally a dictionary of default answers keyed by either question ID if given
or question number. The interpreter will run the questionnaire on the console
and return a dictionary of collected data. The values for options are ordinal
numbers or IDs if given (like in Project type
above -- lang
, gen
).
Please see tests for the detailed usage.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for textx-lang-questionnaire-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 898578ed1f9137b5a53b37989a1606ccac8aeb74dc86bbbbb989f18626f84475 |
|
MD5 | 06089fe7c146eb3d0f7ee73aff994648 |
|
BLAKE2b-256 | bf67ac838cbedb6ec5d5d1b26e9dc6c77598ea23ee96970c5db9649b5694a998 |
Hashes for textx_lang_questionnaire-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e04ef6ef43b33eaaa9acc316faf07f8ea0d6f71e5a27d86cb1285c5f689eaae |
|
MD5 | fdd31989dba24a7fa7ba9a193791e819 |
|
BLAKE2b-256 | 383fa24c15e5a3ed606a18ffcdedb63a00d2e85eaabd03be8482a240789fb738 |