spectrl 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spectrl-0.1.0/.github/workflows/ci.yml +109 -0
- spectrl-0.1.0/.github/workflows/publish.yml +80 -0
- spectrl-0.1.0/.gitignore +12 -0
- spectrl-0.1.0/CHANGELOG.md +56 -0
- spectrl-0.1.0/CITATION.cff +27 -0
- spectrl-0.1.0/CODE_OF_CONDUCT.md +45 -0
- spectrl-0.1.0/CONTRIBUTING.md +65 -0
- spectrl-0.1.0/LICENSE +202 -0
- spectrl-0.1.0/NOTICE +14 -0
- spectrl-0.1.0/PKG-INFO +216 -0
- spectrl-0.1.0/README.md +185 -0
- spectrl-0.1.0/SPECIFICATION.md +346 -0
- spectrl-0.1.0/bench_sizes.py +76 -0
- spectrl-0.1.0/conftest.py +4 -0
- spectrl-0.1.0/js/.gitignore +3 -0
- spectrl-0.1.0/js/README.md +71 -0
- spectrl-0.1.0/js/package-lock.json +600 -0
- spectrl-0.1.0/js/package.json +44 -0
- spectrl-0.1.0/js/scripts/gen_reverse_vectors.ts +121 -0
- spectrl-0.1.0/js/src/base64url.ts +59 -0
- spectrl-0.1.0/js/src/canonical.ts +99 -0
- spectrl-0.1.0/js/src/codecs.ts +67 -0
- spectrl-0.1.0/js/src/cv.ts +73 -0
- spectrl-0.1.0/js/src/hash.ts +14 -0
- spectrl-0.1.0/js/src/header.ts +210 -0
- spectrl-0.1.0/js/src/index.ts +88 -0
- spectrl-0.1.0/js/src/model.ts +78 -0
- spectrl-0.1.0/js/src/msgpack.ts +333 -0
- spectrl-0.1.0/js/src/numpress.ts +250 -0
- spectrl-0.1.0/js/src/token.ts +26 -0
- spectrl-0.1.0/js/src/url.ts +48 -0
- spectrl-0.1.0/js/src/zlibp.ts +11 -0
- spectrl-0.1.0/js/test/codecs.test.ts +107 -0
- spectrl-0.1.0/js/test/reverse.test.ts +48 -0
- spectrl-0.1.0/js/test/roundtrip.test.ts +115 -0
- spectrl-0.1.0/js/test/vectors.test.ts +121 -0
- spectrl-0.1.0/js/tsconfig.json +19 -0
- spectrl-0.1.0/justfile +13 -0
- spectrl-0.1.0/pyproject.toml +67 -0
- spectrl-0.1.0/schema/registry.json +727 -0
- spectrl-0.1.0/scripts/gen_vectors.py +334 -0
- spectrl-0.1.0/scripts/generate_registry.py +438 -0
- spectrl-0.1.0/src/spectrl/__init__.py +221 -0
- spectrl-0.1.0/src/spectrl/cli.py +88 -0
- spectrl-0.1.0/src/spectrl/codecs/__init__.py +78 -0
- spectrl-0.1.0/src/spectrl/codecs/numpress.py +73 -0
- spectrl-0.1.0/src/spectrl/codecs/raw.py +17 -0
- spectrl-0.1.0/src/spectrl/cv.py +117 -0
- spectrl-0.1.0/src/spectrl/header.py +346 -0
- spectrl-0.1.0/src/spectrl/model.py +134 -0
- spectrl-0.1.0/src/spectrl/mzml.py +173 -0
- spectrl-0.1.0/src/spectrl/peaks.py +175 -0
- spectrl-0.1.0/src/spectrl/proforma.py +23 -0
- spectrl-0.1.0/src/spectrl/token.py +40 -0
- spectrl-0.1.0/test-vectors/README.md +63 -0
- spectrl-0.1.0/test-vectors/reverse-vectors.json +695 -0
- spectrl-0.1.0/test-vectors/vectors.json +947 -0
- spectrl-0.1.0/tests/conftest.py +94 -0
- spectrl-0.1.0/tests/data/BSA1.mzML +90041 -0
- spectrl-0.1.0/tests/data/example.mzML +337 -0
- spectrl-0.1.0/tests/data/example.mzML.gz +0 -0
- spectrl-0.1.0/tests/test_canonical_hash.py +74 -0
- spectrl-0.1.0/tests/test_cv_binding.py +83 -0
- spectrl-0.1.0/tests/test_edge_cases.py +124 -0
- spectrl-0.1.0/tests/test_mzml_bridge.py +79 -0
- spectrl-0.1.0/tests/test_registry.py +82 -0
- spectrl-0.1.0/tests/test_roundtrip.py +149 -0
- spectrl-0.1.0/tests/test_strip_top_key.py +61 -0
- spectrl-0.1.0/tests/test_vectors.py +134 -0
- spectrl-0.1.0/uv.lock +364 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: test (py${{ matrix.python-version }})
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ["3.12", "3.13"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v5
|
|
26
|
+
with:
|
|
27
|
+
enable-cache: true
|
|
28
|
+
|
|
29
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
30
|
+
run: uv python install ${{ matrix.python-version }}
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: uv sync --all-extras --dev
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: uv run pytest tests/ -q
|
|
37
|
+
|
|
38
|
+
lint:
|
|
39
|
+
name: lint
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- name: Install uv
|
|
45
|
+
uses: astral-sh/setup-uv@v5
|
|
46
|
+
with:
|
|
47
|
+
enable-cache: true
|
|
48
|
+
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
run: uv sync --all-extras --dev
|
|
51
|
+
|
|
52
|
+
- name: ruff check
|
|
53
|
+
run: uv run ruff check src/ tests/
|
|
54
|
+
|
|
55
|
+
- name: ruff format --check
|
|
56
|
+
run: uv run ruff format --check src/ tests/
|
|
57
|
+
|
|
58
|
+
build:
|
|
59
|
+
name: build
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
|
|
64
|
+
- name: Install uv
|
|
65
|
+
uses: astral-sh/setup-uv@v5
|
|
66
|
+
|
|
67
|
+
- name: Build sdist and wheel
|
|
68
|
+
run: uv build
|
|
69
|
+
|
|
70
|
+
- name: Check distribution metadata
|
|
71
|
+
run: uvx twine check dist/*
|
|
72
|
+
|
|
73
|
+
- name: Upload artifacts
|
|
74
|
+
uses: actions/upload-artifact@v4
|
|
75
|
+
with:
|
|
76
|
+
name: dist
|
|
77
|
+
path: dist/*
|
|
78
|
+
|
|
79
|
+
js:
|
|
80
|
+
name: js (node ${{ matrix.node-version }})
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
defaults:
|
|
83
|
+
run:
|
|
84
|
+
working-directory: js
|
|
85
|
+
strategy:
|
|
86
|
+
fail-fast: false
|
|
87
|
+
matrix:
|
|
88
|
+
node-version: ["20", "22"]
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/checkout@v4
|
|
91
|
+
|
|
92
|
+
- name: Set up Node ${{ matrix.node-version }}
|
|
93
|
+
uses: actions/setup-node@v4
|
|
94
|
+
with:
|
|
95
|
+
node-version: ${{ matrix.node-version }}
|
|
96
|
+
cache: npm
|
|
97
|
+
cache-dependency-path: js/package-lock.json
|
|
98
|
+
|
|
99
|
+
- name: Install dependencies
|
|
100
|
+
run: npm ci
|
|
101
|
+
|
|
102
|
+
- name: Typecheck
|
|
103
|
+
run: npm run typecheck
|
|
104
|
+
|
|
105
|
+
- name: Test (validates against ../test-vectors)
|
|
106
|
+
run: npm test
|
|
107
|
+
|
|
108
|
+
- name: Build
|
|
109
|
+
run: npm run build
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: publish-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: false
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish-pypi:
|
|
14
|
+
name: Publish to PyPI
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
environment:
|
|
17
|
+
name: pypi
|
|
18
|
+
url: https://pypi.org/project/spectrl/
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read # checkout (required on private repos when permissions is set)
|
|
21
|
+
id-token: write # OIDC for PyPI Trusted Publishing
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v5
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --all-extras --dev
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: uv run pytest tests/ -q
|
|
35
|
+
|
|
36
|
+
- name: Build sdist and wheel
|
|
37
|
+
run: uv build
|
|
38
|
+
|
|
39
|
+
- name: Check distribution metadata
|
|
40
|
+
run: uvx twine check dist/*
|
|
41
|
+
|
|
42
|
+
- name: Publish to PyPI
|
|
43
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
44
|
+
|
|
45
|
+
publish-npm:
|
|
46
|
+
name: Publish to npm
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
defaults:
|
|
49
|
+
run:
|
|
50
|
+
working-directory: js
|
|
51
|
+
permissions:
|
|
52
|
+
contents: read # checkout (required on private repos when permissions is set)
|
|
53
|
+
id-token: write # OIDC for npm provenance attestation
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v4
|
|
56
|
+
|
|
57
|
+
- name: Set up Node
|
|
58
|
+
uses: actions/setup-node@v4
|
|
59
|
+
with:
|
|
60
|
+
node-version: "22"
|
|
61
|
+
registry-url: "https://registry.npmjs.org"
|
|
62
|
+
cache: npm
|
|
63
|
+
cache-dependency-path: js/package-lock.json
|
|
64
|
+
|
|
65
|
+
- name: Install dependencies
|
|
66
|
+
run: npm ci
|
|
67
|
+
|
|
68
|
+
- name: Typecheck
|
|
69
|
+
run: npm run typecheck
|
|
70
|
+
|
|
71
|
+
- name: Test (validates against ../test-vectors)
|
|
72
|
+
run: npm test
|
|
73
|
+
|
|
74
|
+
- name: Build
|
|
75
|
+
run: npm run build
|
|
76
|
+
|
|
77
|
+
- name: Publish to npm
|
|
78
|
+
run: npm publish --provenance --access public
|
|
79
|
+
env:
|
|
80
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
spectrl-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
The **token format version** (the `spectrl1` magic prefix) is versioned
|
|
9
|
+
independently of the library version; see [SPECIFICATION.md](SPECIFICATION.md).
|
|
10
|
+
|
|
11
|
+
## [Unreleased]
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- Apache-2.0 `LICENSE` and `NOTICE`.
|
|
15
|
+
- `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `CITATION.cff`.
|
|
16
|
+
- GitHub Actions CI (Python test/lint/build + JavaScript test/typecheck/build).
|
|
17
|
+
- `SPECIFICATION.md` — normative token format specification (draft).
|
|
18
|
+
- `test-vectors/vectors.json` — language-agnostic conformance vectors generated
|
|
19
|
+
from the Python reference impl (`scripts/gen_vectors.py`), with `tests/test_vectors.py`
|
|
20
|
+
pinning them.
|
|
21
|
+
- `js/` — independent JavaScript/TypeScript implementation (`@spectrl/spectrl`)
|
|
22
|
+
with a faithful MS-Numpress port, custom msgpack, and SHA-256 content hashing.
|
|
23
|
+
Decodes Python-produced tokens byte-for-byte and validates against the shared
|
|
24
|
+
vectors.
|
|
25
|
+
- **Bidirectional interop testing**: `test-vectors/reverse-vectors.json` (tokens
|
|
26
|
+
encoded by JS) decoded by the Python impl, proving JS → Python in addition to
|
|
27
|
+
the existing Python → JS direction. Plus expanded unit coverage on both sides
|
|
28
|
+
(base64url, msgpack/`stripTopKey`, numpress size boundaries, byte-slice header
|
|
29
|
+
surgery, ordering/duplicates/value-extremes/URL bindings).
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- **Single-peak lossy spectra** failed to decode: `pynumpress` emits a 12-byte
|
|
33
|
+
linear blob for a 1-element array but its decoder rejects it. The codec wrapper
|
|
34
|
+
now decodes the degenerate 12-byte case directly (per the MS-Numpress reference),
|
|
35
|
+
making single-peak tokens round-trip and agree with the JS implementation.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
- **Non-`MS:` parameter-map keys** are now encoded as the full accession string
|
|
39
|
+
(e.g. `"UO:0000031"`) rather than the previously-specified `[ontology, tail]`
|
|
40
|
+
array, which could not be a msgpack-map key. Fixes a latent crash in the
|
|
41
|
+
Python reference impl; exercised by the `non_ms_ontology_param_key` vector.
|
|
42
|
+
(No released token used the old form.)
|
|
43
|
+
- **Hash verification** now derives the "header without key 9" by byte-slicing
|
|
44
|
+
the serialized header rather than re-encoding a parsed structure, so it no
|
|
45
|
+
longer depends on a canonical msgpack form. The hash value is unchanged.
|
|
46
|
+
- Clarified that the content hash is a per-token integrity check, not a stable
|
|
47
|
+
cross-implementation content identifier; softened "deterministic" wording in
|
|
48
|
+
the README and `SPECIFICATION.md` accordingly.
|
|
49
|
+
|
|
50
|
+
## [0.1.0] - 2026-06-08
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- Initial implementation: `encode_spectrum`, `decode_token`, mzML bridge,
|
|
54
|
+
MS-Numpress + raw codecs, ProForma interpretation, canonical hashing,
|
|
55
|
+
URL/data-URI bindings, and CLI.
|
|
56
|
+
- `schema/registry.json` — machine-readable CV/codec/key registry.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use spectrl, please cite it using these metadata."
|
|
3
|
+
title: "spectrl: Inline Spectrum URL Encoder for mass spectrometry"
|
|
4
|
+
abstract: >-
|
|
5
|
+
spectrl encodes a complete mass spectrum — peaks, metadata, and precursor
|
|
6
|
+
information — into a single compact, URL-safe token, enabling spectra to be
|
|
7
|
+
shared directly in URLs, QR codes, notebooks, and publications without a
|
|
8
|
+
backend repository. It is designed to be complementary to the HUPO-PSI
|
|
9
|
+
Universal Spectrum Identifier (USI) and ProForma.
|
|
10
|
+
type: software
|
|
11
|
+
authors:
|
|
12
|
+
- family-names: Garrett
|
|
13
|
+
given-names: Patrick
|
|
14
|
+
email: pgarrett@scripps.edu
|
|
15
|
+
affiliation: Scripps Research
|
|
16
|
+
license: Apache-2.0
|
|
17
|
+
repository-code: "https://github.com/pgarrett-scripps/spectrl"
|
|
18
|
+
keywords:
|
|
19
|
+
- mass spectrometry
|
|
20
|
+
- proteomics
|
|
21
|
+
- mzML
|
|
22
|
+
- HUPO-PSI
|
|
23
|
+
- USI
|
|
24
|
+
- ProForma
|
|
25
|
+
- spectrum encoding
|
|
26
|
+
version: 0.1.0
|
|
27
|
+
date-released: 2026-06-08
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment:
|
|
18
|
+
|
|
19
|
+
- Demonstrating empathy and kindness toward other people
|
|
20
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
21
|
+
- Giving and gracefully accepting constructive feedback
|
|
22
|
+
- Accepting responsibility and apologizing to those affected by our mistakes
|
|
23
|
+
- Focusing on what is best for the overall community
|
|
24
|
+
|
|
25
|
+
Examples of unacceptable behavior:
|
|
26
|
+
|
|
27
|
+
- The use of sexualized language or imagery, and sexual attention or advances
|
|
28
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
29
|
+
- Public or private harassment
|
|
30
|
+
- Publishing others' private information without explicit permission
|
|
31
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Enforcement
|
|
35
|
+
|
|
36
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
37
|
+
reported to the project maintainers at **pgarrett@scripps.edu**. All complaints
|
|
38
|
+
will be reviewed and investigated promptly and fairly.
|
|
39
|
+
|
|
40
|
+
## Attribution
|
|
41
|
+
|
|
42
|
+
This Code of Conduct is adapted from the
|
|
43
|
+
[Contributor Covenant](https://www.contributor-covenant.org), version 2.1,
|
|
44
|
+
available at
|
|
45
|
+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Contributing to spectrl
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in improving spectrl. This project aims to become a
|
|
4
|
+
HUPO-PSI standard, so contributions are welcome at two levels:
|
|
5
|
+
|
|
6
|
+
1. **The reference implementation** (this Python library) — bug fixes, codecs,
|
|
7
|
+
performance, tests, docs.
|
|
8
|
+
2. **The format specification** — see [SPECIFICATION.md](SPECIFICATION.md).
|
|
9
|
+
Changes that alter the on-the-wire token format are governed more strictly
|
|
10
|
+
(see *Format changes* below).
|
|
11
|
+
|
|
12
|
+
By contributing, you agree that your contributions are licensed under the
|
|
13
|
+
project's [Apache-2.0 License](LICENSE), and you certify the
|
|
14
|
+
[Developer Certificate of Origin](https://developercertificate.org/) for each
|
|
15
|
+
commit.
|
|
16
|
+
|
|
17
|
+
## Development setup
|
|
18
|
+
|
|
19
|
+
This project uses [uv](https://docs.astral.sh/uv/) and
|
|
20
|
+
[just](https://github.com/casey/just).
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uv sync --all-extras # install runtime + dev + optional deps
|
|
24
|
+
just test # run the test suite
|
|
25
|
+
just lint # run ruff
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If you don't use `just`, the underlying commands are:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv run pytest
|
|
32
|
+
uv run ruff check .
|
|
33
|
+
uv run ruff format --check .
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Pull requests
|
|
37
|
+
|
|
38
|
+
- Open an issue first for anything non-trivial so we can agree on the approach.
|
|
39
|
+
- Keep PRs focused; one logical change per PR.
|
|
40
|
+
- Add or update tests for any behavior change. The round-trip and
|
|
41
|
+
canonical-hash tests are the contract — do not weaken them without discussion.
|
|
42
|
+
- Run `just test` and `just lint` before pushing.
|
|
43
|
+
- Update [CHANGELOG.md](CHANGELOG.md) under `## [Unreleased]`.
|
|
44
|
+
|
|
45
|
+
## Format changes (token wire format)
|
|
46
|
+
|
|
47
|
+
The `spectrl1` token format is normative. Any change that affects how a token
|
|
48
|
+
is produced or parsed — new header keys, codec changes, framing changes —
|
|
49
|
+
**must**:
|
|
50
|
+
|
|
51
|
+
1. Be discussed in an issue tagged `format`.
|
|
52
|
+
2. Update [SPECIFICATION.md](SPECIFICATION.md) and `schema/registry.json`.
|
|
53
|
+
3. Preserve backward compatibility, or bump the format version
|
|
54
|
+
(`spectrl1` → `spectrl2`) per the versioning policy in the specification.
|
|
55
|
+
4. Include round-trip test vectors.
|
|
56
|
+
|
|
57
|
+
Format changes are reviewed against the goal of HUPO-PSI standardization and
|
|
58
|
+
interoperability with [USI](https://www.psidev.info/usi) and
|
|
59
|
+
[ProForma](https://www.psidev.info/proforma).
|
|
60
|
+
|
|
61
|
+
## Reporting bugs
|
|
62
|
+
|
|
63
|
+
Open a GitHub issue with: the spectrl version, a minimal reproducing snippet
|
|
64
|
+
or token, and the expected vs. actual behavior. For decode failures, include
|
|
65
|
+
the (redacted if needed) token or its header inspected via `spectrl inspect`.
|
spectrl-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
spectrl-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
spectrl — Inline Spectrum URL Encoder
|
|
2
|
+
Copyright 2026 Patrick Garrett and the spectrl contributors
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|