Skip to main content

survey-data-dictionary (Python)

English | Español

Python port of survey-data-dictionary. It turns a SurveyStructure into a data dictionary (response columns, allowed values and aliases), serializes it to CSV, and translates response records or tabular data with it. Results match the TypeScript package.

Depends only on survey-structure (the Python port of the contract).

Origin and versions

Python release npm release it reproduces surveyStructureVersion
2.1.0 survey-data-dictionary@2.1.0 (commit 99b1bd1) 2.1.0

The Python version follows the npm version it reproduces; Python-only fixes are post-releases. survey_data_dictionary.UPSTREAM records the npm release and commit. Parity is checked in limesurvey-connector against results produced by the TypeScript package.

Usage

from survey_data_dictionary import build_survey_dictionary, dictionary_to_csv, translate_dataset

dictionary = build_survey_dictionary(structure, aliases={"external_consent": "Q1"})
csv_text = dictionary_to_csv(dictionary)
translated = translate_dataset(dictionary, [{"Q1": "A1"}], response_ids=["r-1"])
  • build_survey_dictionary(structure, *, aliases, source_issues, strict): validates the survey first and raises SurveyStructureValidationError for an invalid one.
  • get_question_dictionary(dictionary, code): entries of one question.
  • translate_response / translate_dataset: values keep sourceValue and gain displayValue; unknown keys are preserved in unmappedValues.
  • map_tabular_dataset(dictionary, headers, rows, ...): align rows by position without collapsing repeated headers.
  • dictionary_to_csv, translated_dataset_to_csv: CSV with spreadsheet formulas neutralized.
  • safe_parse_survey_dictionary, safe_parse_survey_response_dataset: runtime validation of dictionaries and datasets received from elsewhere.

ABSENT marks an omitted optional value (JavaScript undefined); None is JSON null.

License

MIT. The original TypeScript package is by the survey-data-dictionary authors; see its repository.

Metadata

Release files for survey-data-dictionary 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for survey-data-dictionary 2.1.0
File Size Uploaded Provenance Actions
survey_data_dictionary-2.1.0.tar.gz 15.7 kB With provenance Details for survey_data_dictionary-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for survey-data-dictionary 2.1.0
File Interpreter ABI Platform Actions
survey_data_dictionary-2.1.0-py3-none-any.whl Python 3 none any Details for survey_data_dictionary-2.1.0-py3-none-any.whl

Total release size: 33.1 kB

Release files / survey_data_dictionary-2.1.0.tar.gz

Download URL survey_data_dictionary-2.1.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c69ff2fe50aeb2db191ce1d346de1579e8d5cc8b432c020e425823b576ae5372
BLAKE2b-256 checksum
How to use checksums
3d85a06d4fd672c85e2061677d875ce65e9bf5c4b46a0b8333adfe25fa9f9825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / survey_data_dictionary-2.1.0-py3-none-any.whl

Download URL survey_data_dictionary-2.1.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d4d87cf0aa79149f5695ec80d309c97446fe38ff138110419016cee95270fc7
BLAKE2b-256 checksum
How to use checksums
ab585671a434078068f872cf91d673c1bf9abc90a3ed186a91b7a6039dd38ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for survey-data-dictionary 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for survey_data_dictionary-2.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page