verple
Verple is a ridiculously strict and ultra-conservative universal version format, comparator, serializer, and protocol.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.0%) to scientific vocabulary
Keywords
Repository
Verple is a ridiculously strict and ultra-conservative universal version format, comparator, serializer, and protocol.
Basic Info
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
Verple
Verple is a ridiculously strict and ultra-conservative universal version format, comparator, serializer, and protocol.
Design Goals
- 🔒 Ultra-conservative equality: versions are considered different if any field differs (
release,prerelease,postrelease,devrelease,local). - ⚖ Strict conservative ordering: ordering is only permitted when local metadata matches exactly; otherwise ordering raises
ValueErrorto avoid ambiguity. - 🔎 Multi-standard input support: parses version strings from PEP 440, SemVer, Canonical, and Calendar Versioning (CalVer).
- 🔁 Canonical serialization: provides fully reversible serialization via
to_canonical_string()and parsing viafrom_canonical_string(). - 🧮 Hashable and set-safe: fully hashable and safe for use in sets and dictionaries, with hashes consistent with strict equality.
- 📦 JSON-LD serialization: supports semantic serialization with provenance (
sourceFormatandsourceInputfields). - 🔐 Versioned deserialization protocol: fully versioned serialization model allowing future-safe protocol evolution.
- 📚 Use Case Domains: reproducible builds, registries, deployment pipelines, archival systems, provenance tracking, scientific reproducibility.
Supported Python Versions
- Python >= 3.10
Installation
bash
pip install verple
Example Usage
```python from verple import Verple
Parse version string
v1 = Verple.parse("1.2.3a1.post2.dev3+build99") print(v1.tocanonicalstring()) # 1.2.3-a1.post2.dev3+build99
Strict equality
v2 = Verple.parse("1.2.3a1.post2.dev3+build99") assert v1 == v2
Hashable and set-safe
versions = {v1, v2} assert len(versions) == 1
Conservative ordering (only if local metadata matches)
v3 = Verple.parse("1.2.4+build99") assert v1 < v3
JSON-LD serialization
jsonld = v1.tojsonld() v1roundtrip = Verple.fromjsonld(jsonld) assert v1 == v1roundtrip ```
Canonical Serialization Format
Verple canonical strings follow this grammar:
<release>[-<prerelease>][.post<N>][.dev<N>][+<local>]
Example:
1.2.3-a1.post2.dev3+build99
JSON-LD Serialization Format
Verple also supports semantic serialization:
json
{
"@context": "https://gitlab.com/willynilly/verple/-/raw/main/src/verple/context/v1.0.0.jsonld",
"@type": "Verple",
"verple": "1.0.0",
"sourceFormat": "pep440",
"sourceInput": "1.2.3a1.post2.dev3+build99",
"release": [1, 2, 3],
"prerelease": ["a", 1],
"postrelease": 2,
"devrelease": 3,
"local": "build99"
}
This allows full provenance and schema evolution.
Tests
This project uses pytest:
bash
pytest tests/
Protocol Semantics
Normalization
Verple normalizes versions into a fully structured model with the following fields:
release: tuple of integers (major, minor, patch, or calendar parts)prerelease: tuple of(label: str, num: int)orNonepostrelease: integer orNonedevrelease: integer orNonelocal: string orNonesourceInput: original version stringsourceFormat: the parsed format (pep440,semver,canonical,calver)
All formats (PEP 440, SemVer, Canonical, CalVer) are converted into this internal structure.
Equality Algorithm
Two versions are equal if and only if all of the following fields are equal:
releaseprereleasepostreleasedevreleaselocal
Fields are compared strictly; any difference implies inequality.
Ordering Algorithm
Ordering is permitted only if both versions have identical local metadata. If local differs, ordering is refused.
If allowed, versions are compared using the tuple:
(
release,
prerelease_key(prerelease),
postrelease or -1,
devrelease or infinity
)
Where:
prerelease_key(None)→(infinity,)(normal releases sort after prereleases)prerelease_key((label, num))→(label, num)(string then numeric comparison)
The algorithm aligns with PEP 440 precedence where applicable.
Canonical Form Algorithm
Serialization via to_canonical_string() reconstructs the version string as:
<release>[-<prerelease>][.post<N>][.dev<N>][+<local>]
Fields that are None are omitted.
JSON-LD Serialization
The full semantic model is serialized as JSON-LD, including provenance fields sourceFormat and sourceInput for full reproducibility.
Field Definitions
The following fields are used throughout Verple's internal model, canonical serialization, and JSON-LD serialization:
| Field | Type | Meaning |
|--------------|------------------|-------------------------------------------------------------|
| release | tuple of int | Core version numbers: major.minor.patch or calendar parts |
| prerelease | tuple (str, int) or None | Pre-release stage (alpha, beta, rc, etc.) and stage number |
| postrelease | int or None | Post-release revision applied after final release |
| devrelease | int or None | Development release version for pre-release internal builds |
| local | str or None | Local build metadata identifier (build info, git hash, etc.) |
| sourceInput | str | The original version string provided as input |
| sourceFormat | str | The detected format: pep440, semver, canonical, or calver |
| verple | str | Serialization format version (e.g. "1.0.0") |
| @context | URL | JSON-LD context URL defining linked data vocabulary |
| @type | str | Always "Verple" |
Conceptual Definitions
release: The main numeric version (e.g.
1.2.3), structured as Major.Minor.Patch (SemVer, PEP 440) or Year.Month.Day.prerelease: A pre-final release marker such as
alpha,beta, orrc, optionally followed by a stage number (e.g.rc1).postrelease: Identifies patches or hotfixes applied after a final release (
.postN).devrelease: Development snapshots issued before formal releases (
.devN), typically for internal or unstable builds.local: Build metadata or local identifiers following
+buildsemantics, capturing build environment or other internal state.sourceInput: The raw version string provided by the caller.
sourceFormat: Indicates which parser was used to interpret the input (
pep440,semver,canonical,calver).verple: The version of the Verple serialization protocol used to encode the JSON-LD document.
@context / @type: JSON-LD linked data metadata used to enable semantic parsing of Verple objects.
License
Apache 2.0
Author
- Will Riley
- Co-developed with ChatGPT-4o during protocol design.
Owner
- Name: Will Riley
- Login: willynilly
- Kind: user
- Location: Arnhem, The Nederlands
- Company: Wageningen University & Research
- Website: http://willriley.net
- Repositories: 36
- Profile: https://github.com/willynilly
Ph.D. in Educational Psychology (Applied Cognition and Development) from University of Georgia
Citation (CITATION.cff)
cff-version: 1.2.0
title: Verple
message: >
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Will
family-names: Riley
email: wanderingwill@gmail.com
orcid: "https://orcid.org/0000-0003-1822-6756"
repository-code: >
https://github.com/willynilly/verple
abstract: >
Verple is a ridiculously strict and ultra-conservative universal version format, comparator, serializer, and protocol.
keywords:
- versioning
- semantic versioning
- pep440
- semver
- calver
- version parser
- json-ld
- provenance
license: Apache-2.0
version: "1.0.0"
date-released: "2025-06-13"
references:
- type: software
title: packaging
version: "25.0"
url: https://pypi.org/project/packaging/25.0/
authors:
- name: Donald Stufft
- type: software
title: semver (Python package)
version: "3.0.4"
url: https://pypi.org/project/semver/3.0.4/
authors:
- name: Konstantine Rybnikov
- type: software
title: re (Python stdlib)
url: https://docs.python.org/3/library/re.html
authors:
- name: Python Software Foundation
- type: standard
title: PEP 440 — Python Versioning Specification
url: https://peps.python.org/pep-0440/
authors:
- name: Donald Stufft
- name: Alyssa Coghlan
- type: standard
title: Semantic Versioning 2.0.0 (SemVer spec)
url: https://semver.org/spec/v2.0.0.html
authors:
- name: Tom Preston-Werner
- type: standard
title: Calendar Versioning (CalVer Specification)
url: https://sedimental.org/calver.html
authors:
- name: Mahmoud Hashemi
GitHub Events
Total
- Release event: 1
- Issue comment event: 2
- Push event: 8
- Pull request event: 6
- Create event: 1
Last Year
- Release event: 1
- Issue comment event: 2
- Push event: 8
- Pull request event: 6
- Create event: 1
Packages
- Total packages: 1
-
Total downloads:
- pypi 126 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
pypi.org: verple
Verple is a ridiculously strict and ultra-conservative universal version format, comparator, serializer, and protocol.
- Homepage: https://github.com/willynilly/verple
- Documentation: https://github.com/willynilly/verple#readme
- License: Apache Software License
-
Latest release: 1.0.0
published 8 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
- actions/checkout v3 composite
- actions/setup-python v5 composite
- willynilly/cff-author-updater v2.3.0 composite
- packaging >=25.0
- semver >=3.0.4