Skip to main content

triple-s

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

Still a work in progress. The current plan is to complete support for reading triple-s files first, followed by implementing support for writing files later.

Python

Getting started

Install with:

pip install triple-s

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.

...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)

Rust

Add the crate to your project, and browse relevant documentations from cargo

[dependencies]
triple_s = "0.1"

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, and some boilerplate code realted with text parsing in src/classic.rs.

Otherwise most of the stuffs are writtem by myself.

License

MIT license

Metadata

Release files for triple-s-survey 0.2.3

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.2.3
File Size Uploaded Provenance
triple_s_survey-0.2.3.tar.gz 109.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for triple-s-survey 0.2.3
File Interpreter ABI Platform
triple_s_survey-0.2.3-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 3.6 MB

Release files / triple_s_survey-0.2.3.tar.gz

Download URL triple_s_survey-0.2.3.tar.gz
Size 109.6 kB
Tags Source
SHA-256 checksum
How to use checksums
27838303b7158e184a6d60e72425f6d9914df35ada123a5fed591a10dc08cbce
BLAKE2b-256 checksum
How to use checksums
bf655ecc5417edb8b792804d651ef9679d95455865f760a87e97fd29372093a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL triple_s_survey-0.2.3-cp310-abi3-macosx_11_0_arm64.whl
Size 3.5 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b5498d13133569beb427ba00819ea2a7e354a40d4bead5b2b7b276d15790d3ca
BLAKE2b-256 checksum
How to use checksums
41e1d72fc6fd696ed9d52becd8930799bb1192c2f538073eb49cad15d8722f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for triple-s-survey 0.2.3

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.

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