Skip to main content

YLSpec

CI PyPI version PyPI distributions License: Apache 2.0 Format: 0.1 Python: 3.11–3.15 C: C11 JavaScript and TypeScript JVM and Android VS Code Platforms

Portable metadata documents that work on their own and inside other file formats.

YLSpec defines a versioned document envelope around TOML 1.1 and an optional, length-delimited binary frame for embedding that document into another file. The reference implementation is written in C11. Its Python package uses the same C core through a native CPython extension. JavaScript and TypeScript use Node-API on Node.js and WebAssembly in browsers and React applications. Java and Kotlin use JNI on desktop JVMs and Android. A VS Code extension brings the same parser to .ylspec editing.

Status: 0.1.2, experimental. The specification and APIs may change before 1.0. Review the compatibility policy before depending on an experimental version. A release's support claims are backed by its linked GitHub Actions run. Package-registry publication requires the account setup described in the registry guide; release assets can be used independently of those uploads.

Why YLSpec?

Applications frequently need the same metadata in several contexts: editable configuration, a component manifest, or a small record embedded in a larger binary file. YLSpec gives those contexts a shared document model and an explicit version boundary.

Capability Standalone document Embedded frame
Human-editable UTF-8 TOML 1.1 Yes The payload is the same text
Standard and profile versioning Yes Yes
Namespaced project extensions Yes Yes
Exact temporal literals Yes Yes
Read without touching unrelated host content Entire document Header plus declared document bytes
Requires an archive or decompressor No No
Executes embedded code No No

YLSpec does not define plugin execution, package installation, dependency resolution, signatures, or a host file's layout. Future formats can place YLSpec frames wherever their own headers or indexes specify.

Architecture

flowchart LR
    Text["Standalone .ylspec text"] --> Core["C11 document core"]
    Host["Host-supplied offset and region"] --> Frame["32-byte frame decoder"]
    Frame --> Core
    Core --> Values["Typed document values"]
    Values --> Profile["Explicit profile validation"]
    Core --> Python["Native Python API"]
    Core --> Node["Node-API: JavaScript and TypeScript"]
    Core --> WASM["WebAssembly: browser and React"]
    Core --> JNI["JNI: Java, Kotlin, and Android"]
    WASM --> Editor["VS Code language tools"]
    Core --> CLI["Inspection CLI"]

The embedding guide explains the byte layout and the host's responsibilities. The normative specification defines document validity independently of the reference implementation.

Installation

Install the published native Python package with:

python -m pip install ylspec

Published versions are available on PyPI and in the checksummed GitHub Releases. For offline installation, download a matching release wheel and install it with python -m pip install path/to/the-wheel.whl. Verification-only builds are also available in successful CI runs' wheels-* artifacts.

Native release assets contain both static/ and shared/ installations, with headers, libraries, CLI binaries, CMake package exports, and license notices. Choose one installation as your CMake prefix:

find_package(YLSpec CONFIG REQUIRED)
target_link_libraries(my_application PRIVATE YLSpec::ylspec)

See building for source builds and supported toolchains.

Other language packages

Consumer Distribution Integration guide
JavaScript / TypeScript / Node.js @younglionorganization/ylspec, native Node-API JavaScript API
Browser / React The same npm package, bundled C WebAssembly Browser initialization
Java / Kotlin desktop xyz.younglion:ylspec and ylspec-kotlin JVM guide
Android Common Java/Kotlin API plus ylspec-android JNI AAR Android dependencies
VS Code ylvsmp.ylspec / ylspec-0.1.2.vsix; language tools using bundled WebAssembly Editor guide

These names describe the built distributions. npm, Central, and Marketplace listings become available after their separate publishing workflows succeed. Until then, use the checksummed tarball, Maven-layout ZIP, or VSIX from the GitHub Release. No registry availability badge is shown before publication.

import {createClient} from '@younglionorganization/ylspec';
const yl = await createClient();
const document = new yl.Document({name: 'Example', count: 42n});
const restored = yl.unpack(yl.pack(document));
console.assert(restored.data.count === 42n);

Integer values are bigint in JavaScript and Long in Java/Kotlin. Exact temporal values retain their original fractional precision across adapters. The type mapping explains conversion boundaries. Browser initialization is asynchronous; once initialized, in-memory parsing and framing use the same synchronous C implementation.

Document example

[_ylspec]
version = "0.1"
profile = "core.data"
profile_version = "0.1"

[data]
name = "Example component"
enabled = true
platforms = ["linux-x86_64", "windows-x64", "macos-arm64"]

[extensions."xyz.younglion.example"]
channel = "stable"

data is application-defined. An application's version inside data is independent of the YLSpec format version and the profile version.

Python quick start

The complete, CI-executed example is examples/basic.py.

import io
import ylspec

document = ylspec.Document({"name": "Example", "enabled": True})
document.validate()

text = ylspec.dumps(document)
restored = ylspec.loads(text)
assert restored.data == document.data

prefix = b"host-defined prefix"
frame = ylspec.pack(document)
host = io.BytesIO(prefix + frame + b"unrelated payload")
metadata = ylspec.read_at(host, offset=len(prefix), available=len(frame))
assert metadata.data["name"] == "Example"

read_at restores the stream's original position. It reads the 32-byte header and exactly the document bytes declared in that header. Determining the region size may seek to the end, but does not read the host payload.

See the Python API for types, profile validators, errors, and exact timestamps. Detailed __init__.pyi and _native.pyi stubs and a py.typed marker ship with the package for editor completion and static checks; no separate stub distribution is required.

C quick start

The complete, CI-executed example is examples/basic.c.

#include <stdio.h>
#include <string.h>
#include <ylspec.h>

int main(void) {
    const char text[] =
        "[_ylspec]\nversion='0.1'\nprofile='core.data'\n"
        "profile_version='0.1'\n[data]\nname='Example'\n";
    yl_document *document = NULL;
    yl_error error = {0};
    if (yl_parse(text, strlen(text), NULL, &document, &error) != YL_OK) {
        fprintf(stderr, "%s\n", error.message);
        return 1;
    }
    yl_document_free(document);
    return 0;
}

Lengths are explicit; the input does not need a terminating NUL. The core does not open files. A host can supply a yl_read_at_fn callback to read an embedded document from a file, mapping, device, or other bounded source.

Resource limits and trust boundaries

Property Default or policy
Maximum document text 16 MiB; configurable
Maximum value depth 64 edges from root; configurable up to 128
Frame header 32 bytes, little-endian
Embedded text UTF-8 TOML 1.1, uncompressed
Integer / float Signed 64-bit / IEEE-754 binary64
Required feature or profile validation Explicit; unsupported means failure
Integrity and authenticity Supplied by the host, if needed

Additional parser limits are listed in compatibility. Parsing does not imply profile approval, cryptographic verification, or permission to execute host content. See security.

CLI

ylspec --version
ylspec validate examples/config.ylspec
ylspec inspect examples/manifest.ylspec
ylspec pack examples/config.ylspec > metadata.bin
ylspec inspect-frame metadata.bin 0

See the CLI reference for commands, output, and exit codes.

Verification and releases

GitHub Actions builds static/shared C artifacts and Python wheels, runs C and Python tests, checks TOML 1.1 decoding against toml-test, runs sanitizers and bounded fuzzing, executes documentation examples, and renders Mermaid diagrams. Benchmark reports record the workload and environment without asserting an unmeasured speed threshold.

Language verification executes Node-API and JNI on the target systems, tests TypeScript ESM/CommonJS consumers, launches React in Chromium, builds four Android ABIs, executes JNI on an API 26 emulator, and tests a real VS Code Extension Host before packaging the VSIX.

The manually dispatched publish workflow rebuilds and verifies one commit, creates a draft release, attaches checksummed assets, publishes the same Python distributions to PyPI using the PYPI_API_TOKEN GitHub Actions secret, and then publishes the GitHub Release. Read publishing before the first release. Separate npm, Maven Central, and VS Code workflows consume the public release's checksummed artifacts. See registry setup for exact secret names, account ownership, and upload steps.

Documentation map

Guide Audience
Specification Independent implementers
Embedding Host-format designers
Profiles and extensions Application developers
C API and ownership C integrators
Python API and types Python integrators
JavaScript, TypeScript, browser, and React Web and Node.js developers
Java, Kotlin, and Android JVM and Android developers
VS Code integration Editor users and extension maintainers
CLI Users inspecting documents
Building Native-library consumers
Compatibility Maintainers and adopters
Publishing Release maintainers
Registry accounts and secrets Package publishers

License and authorship

Copyright 2026 Cavanşir Qurbanzadə. Created under YoungLionOrganization. Original project material is licensed under Apache-2.0. See NOTICE, AUTHORS.md, and third-party notices. A document created by a user does not acquire this project's license merely by using the YLSpec format.

Metadata

Release files for ylspec 0.1.2

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

Source distribution (sdist)

Source distribution for ylspec 0.1.2
File Size Uploaded Provenance Actions
ylspec-0.1.2.tar.gz 176.2 kB Without provenance Details for ylspec-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ylspec 0.1.2
File Actions
ylspec-0.1.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for ylspec-0.1.2-cp311-abi3-win_amd64.whl
ylspec-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for ylspec-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl
ylspec-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for ylspec-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl
ylspec-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for ylspec-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
ylspec-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 Details for ylspec-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
ylspec-0.1.2-cp311-abi3-macosx_11_0_x86_64.whl CPython 3.11 abi3 macOS 11.0+ x86-64 Details for ylspec-0.1.2-cp311-abi3-macosx_11_0_x86_64.whl
ylspec-0.1.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for ylspec-0.1.2-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 638.0 kB

Release files / ylspec-0.1.2.tar.gz

Download URL ylspec-0.1.2.tar.gz
Size 176.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cbfc7656379dbc55903f522409623b9a8ac172f14d050d179fb1a1508bf92c94
BLAKE2b-256 checksum
How to use checksums
33fda1ea03ab7f4aba48d8e1efcd26dd5cb96ff1d5c010516410cbc6687c3151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ylspec-0.1.2-cp311-abi3-win_amd64.whl

Download URL ylspec-0.1.2-cp311-abi3-win_amd64.whl
Size 59.6 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b955838fadf73d9f6717298f49e034c9e0c6e99d296ac73a6b58022b5c8e9d08
BLAKE2b-256 checksum
How to use checksums
d317c0017383dafb1714197516f9a524b15f1eac668f3e3d7ab1b053b136850e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ylspec-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL ylspec-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl
Size 70.4 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
6adcb0ffd04527525a5b3ee9f20dc51cbed6fd5011561a7c2f5c478fddf3988b
BLAKE2b-256 checksum
How to use checksums
fb76b187052e684700325414e4237e90b214d6b88ddaf93071671cee6c955c83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ylspec-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL ylspec-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl
Size 70.2 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
2c6c3a8bbe16f6eab5b2b355c14016eb3a77eff293f3d7cd6a559e1617ff9a7d
BLAKE2b-256 checksum
How to use checksums
dece5bd74c994e747e1432c6a32c66c31d4bba6714745f17a1cab37b612c4e93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ylspec-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL ylspec-0.1.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 70.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
9bc1bd6da06e90f4ac4c399172716efa364bea2df840042d3807e27ff3bc44bb
BLAKE2b-256 checksum
How to use checksums
a589e3099817157bf25705b9203006116d2e53bf8d534ec07628e95810b93465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ylspec-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL ylspec-0.1.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 70.0 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
1487979a2ba56d0076f7791b5a5c19e6a428e0056b43c4133f705cb4ac16d853
BLAKE2b-256 checksum
How to use checksums
fd285ce07b405d99e527176d2f42a5d9e66ab748faf98280ff4d55c0c34482c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ylspec-0.1.2-cp311-abi3-macosx_11_0_x86_64.whl

Download URL ylspec-0.1.2-cp311-abi3-macosx_11_0_x86_64.whl
Size 60.9 kB
Tags CPython 3.11 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
dc25aa20379c7b17d4d7e8755b3964bc4b18d58b44f7f9ae3a098fe0d619731d
BLAKE2b-256 checksum
How to use checksums
c6195f204389b20e14966f9f17d99f733fd7a0fb6459960adf85bd68bd4fd3af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ylspec-0.1.2-cp311-abi3-macosx_11_0_arm64.whl

Download URL ylspec-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Size 59.9 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
97945eaaab57524bbc21685dc2497df6d2278bdd20494acbcfa46b07829b9ddf
BLAKE2b-256 checksum
How to use checksums
5018f1540d48c9550d42feefb1518e1857a9ceb3698c13626911b5907d9063b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ylspec 0.1.2

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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

8 release files No 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