Skip to main content

Influenzanet surveys management library

Project description

Influenzanet Survey Management

influenzanet.surveys is a python library to work with influenzanet surveys, mainly validation and transformation

The purpose of this library is to work with existing surveys in json, it's not designed to create new survey json from scratch (for this use the typescript libraries).

Installation

pip install influenzanet.surveys

# To use validation
pip install influenzanet.surveys[validator]

Features

  • Parse json Survey definition into python object
  • Parse standards survey definition, standards define the common questions/responses encoding for Influenzanet
  • Export survey in several format : html document, readable yaml (see formats)
  • Check survey internal consistency (reference for keys) and compliance to a standard definition

Format

  • html : view of a survey definition in a static html document (this is survey definition for humans)
  • readable : a simplified view of a survey to see survey structure. Expression are transformed into function call-like text to be more readable.

Each format accepts a "context" for the transformation, allowing, for example, to select the languages to be used in the output.

An helper is provided to build html for all json in a directory :

from influenzanet.surveys.html import build_html_from_dir

## Accept glob patterns and transform all surveys json into html (if a json is not a survey it will be ignored)
## Creates an html file in the same directory for each json, replacing existing html if already exists
build_html_from_dir("output/**/surveys", languages=["en","fr"])

Validation and Survey check

TBD

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

influenzanet.surveys-1.0.5.tar.gz (35.7 kB view hashes)

Uploaded Source

Built Distribution

influenzanet.surveys-1.0.5-py3-none-any.whl (44.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page