Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

yapyon (やぴょん)

「YAMLちゃうで。やぴょんやぴょん」 It's not YAML. It's yapyon.

Python-style typed literals with YAML-like block structure. Quoted strings, True/False/None, indentation blocks, - sequences, + multimaps, # comments — and parse-time splicing that replaces YAML's anchors.

name: "api-gateway"
version: 3.10
port: 8080
debug: False

paths:
  root: "/srv/gateway"
  logs: y"{root}/logs"          # -> "/srv/gateway/logs"
  banner: y"{name} v{version}"  # -> "api-gateway v3.10"   (lexeme, not 3.1)

changes:                        # multimap: keys may repeat, order is data
  + registry: {set: ["Bypass"]}
  + file: {delete: ["Edge"]}
  + registry: {remove: ["Edge Update"]}

The pitch: the same bytes mean the same data, to every parser, on every machine, always. No implicit typing (no is not False; there are no unquoted scalars at all), no anchors, no tags, no evaluation, one null spelling, one document per file. A repeated key is an error unless the block says + , so it can never be mistaken for a typo — or silently collapsed, the way Python and YAML both drop {"a": 1, "a": 2} down to one entry.

Status

Pre-alpha, and 0.1.0a1 means it. Lexer, parser, resolver and loader are done and tested — 265 tests, including a conformance suite that turns the splice matrix and the Python divergence table into executable cases.

The normative specification is still a working draft held by the author, so this README summarises the format rather than defining it.

$ pip install --pre yapyon
>>> import yapyon
>>> yapyon.loads('name: "gw"\nport: 8080\naddr: y"{name}:{port}"\n')
{'name': 'gw', 'port': 8080, 'addr': 'gw:8080'}

loads and load return plain Python. Eight of the ten types are builtins; a + block comes back as an OrderedMultimap, and a yt literal as an unfilled Template.

From a checkout, the stages will also dump what they see:

$ pip install -e ".[dev]" && pytest -q
$ python -m yapyon.lexer examples/gateway.ypy    # token dump
$ python -m yapyon.parser examples/gateway.ypy   # AST dump

Prefixes

Spelling Name Spoken Result
b, b64 bytes literals bytes
r, rb raw str, bytes
y yapyon string y-string str, spliced at parse
yb yapyon byte string yeeb-string bytes, spliced at parse
yt yapyon template string yeet-string Template, deferred
ry raw yapyon string ree-string str, backslash literal

f"...", t"...", u"..." are errors with hints — their meaning depends on an enclosing scope, and a data file has none.

Diagnostics

shiran: (warning) → akan: (error) → yakamashiwa: (internal bug). Verbose success prints ええやん.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yapyon-0.1.0a1.tar.gz (50.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yapyon-0.1.0a1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file yapyon-0.1.0a1.tar.gz.

File metadata

  • Download URL: yapyon-0.1.0a1.tar.gz
  • Upload date:
  • Size: 50.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for yapyon-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 2799c53e78c7dc8552425f64e5455d3ed7b44e80fce3a98d1440774db8ea69c2
MD5 86471173d7a6f8eb5d4e4376b7d298df
BLAKE2b-256 6210a11be9fcacae46b0bcaf5cee1d3f0c981961d2be249a12535572617da539

See more details on using hashes here.

File details

Details for the file yapyon-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: yapyon-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for yapyon-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 4035efc34201e134e6506263e335bfc0781fadf6b66d7391388d5acad8de87d3
MD5 0d3a4868f5bd414b7f500d7fd1d25d47
BLAKE2b-256 3750cc91cc3f573e5376b4f86a0aa6382670cd4713e945b6debe121a4b3c58ca

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 files

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