Skip to main content

triple-s

A parser for reading parsing Triple-S datamap files (.sss), backend by rust via PyO3 and maturin.

Most of the core functions are completed, there are some imporvement coming in the future.

Documentations:

Rust: docs.rs

Python: readthedocs.org (under construction, more informative documentation coming soon)

Rust

Add the crate to your project:

cargo add triple_s

More detailed documentations can be foud in docs.rs

Python

Python API mirrors that of Rusts', with some minor tweaks to accomdate python's typing system.

Getting started

Install with:

pip install triple-s-survey

Read a datamap

from triple_s import read_datamap

datamap = read_datamap("path/to/datamap.sss")

print(datamap.title)

Accessing contents within a datamap:

# Lookup by question name, case insensitive
print(datamap["Q1"].label)
print(datamap['q1'].label)  # this will also do

Edit the loaded datamap:

datamap["q1"].title = "New title"
question = datamap["Q1"]
question.text = "Updated question text"

Datamap can be iterated:

for question in datamap:
    print(question.name)

Load triple-s data file

Read .asc data file:

from triple_s import read_datamap

datamap = read_datamap("path/to/datamap.sss")
datamap.load_data("path/to/data.asc")

For CSV data, use a datamap with <record format="csv"> and call datamap.load_data("path/to/data.csv"). Each question's position start is its one-based CSV field number. Set skip="1" on the record to skip a header, or another non-negative number to skip that many initial records. Quoted commas, escaped quotes, and multiline text fields are supported. Both formats support UTF-8 and BOM-marked UTF-16. Loading and validation replace invalid sequences with � (U+FFFD), which counts as one fixed-width character.

...And export to polars dataframe

df = datamap.to_polars()

Exporting

Export instance to sss classic (sss 1.1):

string = datamap.to_classic()
print(string)

Alternatively, insead of the entire datamap, you can also export individual datamap components (i.e., individual questions, question response, data location) as well:

question_string = datamap.record[3].to_classic()
print(question_string)

Development

Install the Python development dependencies and build the extension with:

maturin develop

Run the Rust tests with:

cargo test

AI usage

I handwrote majorities of the code with some very minor support of ai, mostly on writing biolerplate getter & setters, the basic html of python's documentation page, and some routine code realted with text parsing in src/classic.rs. Also, I used AI to evaluate some of the edge cases that I missed.

Everything else, including the source code, the documentation, api interface, example usage etc., are written by myself. If any error/ typo feel free to pull request.

License

MIT license

Metadata

Release files for triple-s-survey 0.4.136

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

Source distribution (sdist)

Source distribution for triple-s-survey 0.4.136
File Size Uploaded Provenance Actions
triple_s_survey-0.4.136.tar.gz 300.7 kB Without provenance Details for triple_s_survey-0.4.136.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for triple-s-survey 0.4.136
File Actions
triple_s_survey-0.4.136-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for triple_s_survey-0.4.136-cp310-abi3-win_amd64.whl
triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_x86_64.whl
triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_aarch64.whl
triple_s_survey-0.4.136-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for triple_s_survey-0.4.136-cp310-abi3-macosx_11_0_arm64.whl
triple_s_survey-0.4.136-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for triple_s_survey-0.4.136-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 132.4 MB

Release files / triple_s_survey-0.4.136.tar.gz

Download URL triple_s_survey-0.4.136.tar.gz
Size 300.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4f347658c376409f8f742f75ab3e2fd13fcc4ff0d2e92a6cc55cbe040f2c6940
BLAKE2b-256 checksum
How to use checksums
08c8553bcf487c4c481c8892d2a21365af1a530fab42c0eef52cf36674a28fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / triple_s_survey-0.4.136-cp310-abi3-win_amd64.whl

Download URL triple_s_survey-0.4.136-cp310-abi3-win_amd64.whl
Size 25.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
81f8288bb990591c32bc7de53b89993c57160bb6e4c224c8cd33856f97b996cf
BLAKE2b-256 checksum
How to use checksums
56b6700644edef04dfc1c5912fdf2b7e4e15cd7cbf538531725627f7895deecf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_x86_64.whl
Size 27.8 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
6d411e29621bbefddbd5e7d65d6e2b1d4fa5e67c82bacb96feefbb6e11a65ad1
BLAKE2b-256 checksum
How to use checksums
1ec7cf50d13cd8d3d6c6c2a606159058405368637010d2b8166db61700ae2f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL triple_s_survey-0.4.136-cp310-abi3-manylinux_2_28_aarch64.whl
Size 30.2 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
442e9a1cb06f015ff7791e6c216a417ef4f56fba677a8a5d646bca755616e924
BLAKE2b-256 checksum
How to use checksums
15a202ec4053098a4cab88eb7c1f780de97c116c97ea82c44ab00fdb92c572ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / triple_s_survey-0.4.136-cp310-abi3-macosx_11_0_arm64.whl

Download URL triple_s_survey-0.4.136-cp310-abi3-macosx_11_0_arm64.whl
Size 24.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
813fa55891ecf842fdc6a015a4ee161e068c1d2afc28db3d4d31ee717f9c51e9
BLAKE2b-256 checksum
How to use checksums
e3e298682d50666309d3147b1b57f10e7facb98b6ff40bb07a1494df80bcec1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / triple_s_survey-0.4.136-cp310-abi3-macosx_10_12_x86_64.whl

Download URL triple_s_survey-0.4.136-cp310-abi3-macosx_10_12_x86_64.whl
Size 25.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2db9a3facbf2d548e4b73e6094bd26213f119baa10825948c980ef3f45ddea72
BLAKE2b-256 checksum
How to use checksums
997b5ec99aae163672e2bd3ae75813a9a1c10987c57ac1ecb33b09ac7405c5b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for triple-s-survey 0.4.136

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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