Skip to main content

jmd-format — Python Reference Implementation

Python reference implementation of the JMD specification (v0.3.5). Includes a C-accelerated parser and serializer, plus lossless XML↔JMD conversion.

Installation

Install the latest version directly from GitHub:

pip install git+https://github.com/ostermeyer/jmd-impl.git

Or pin a specific release:

pip install git+https://github.com/ostermeyer/jmd-impl.git@v0.9.1

Pre-built wheels for Linux, macOS, and Windows are attached to each GitHub Release and can be installed directly:

pip install https://github.com/ostermeyer/jmd-impl/releases/download/v0.9.1/jmd_format-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

The C extensions are built automatically during installation if a C compiler is available. If not, the pure-Python fallback is used transparently.

Quick Start

from jmd import parse, serialize

data = parse("""
# Order
id: 42
status: pending

## customer
name: Anna Müller
email: anna@example.com
""")

print(data)
# {'id': 42, 'status': 'pending', 'customer': {'name': 'Anna Müller', 'email': 'anna@example.com'}}

print(serialize(data, label="Order"))

Document Modes

from jmd import (
    JMDDeleteParser,
    JMDParser,
    JMDQueryParser,
    JMDSchemaParser,
    jmd_mode,
    parse_error,
)

# Detect mode without full parse
mode = jmd_mode(source)   # 'data' | 'query' | 'schema' | 'delete'

# Query by Example (#?)
query = JMDQueryParser().parse("#? Order\nstatus: pending")

# Schema (#!) — canonical structural parser; values remain raw strings
schema = JMDParser().parse("#! Order\nid: integer readonly\nstatus: string")

# Optional legacy type-expression dialect
typed_schema = JMDSchemaParser().parse(
    "#! Order\nid: integer readonly\nstatus: string"
)

# Delete (#-)
delete = JMDDeleteParser().parse("#- Order\nid: 42")

# Error (# Error)
error = parse_error("# Error\nstatus: 404\ncode: not_found\nmessage: Not found")

Streaming

Use jmd_stream() when the complete source is already available:

from jmd import jmd_stream

for event in jmd_stream(source):
    print(event)

For incremental input, consume the events returned by every process_line() call. finish() emits only events still pending at end of input:

from jmd import JMDStreamParser

parser = JMDStreamParser()
for line in source_lines:
    for event in parser.process_line(line):
        print(event)
for event in parser.finish():
    print(event)

Canonical multiline fields emit FIELD_START followed by one FIELD_CONTENT event per blockquote line. The stream_events() and to_lines() async adapters preserve the same incremental behavior.

XML Mapping

Lossless conversion between data XML and JMD (requires lxml):

from jmd.xml import xml_to_jmd, jmd_to_xml

jmd_source = xml_to_jmd(xml_bytes_or_str)  # XML → JMD string
xml_output  = jmd_to_xml(jmd_source)        # JMD → XML bytes

Targets data XML — OOXML (WordprocessingML, DrawingML, SpreadsheetML), SOAP, XBRL, XRechnung, and similar formats. Mixed-content XML (ODF, XHTML) is out of scope.

See the JMD over XML companion specification for the full mapping rules.

C Extensions

Build manually if needed:

python build_ext.py build_ext --inplace

Specification

See jmd-spec for the full format specification, benchmark results, and design documentation.

License

Licensed under the Apache License, Version 2.0. See LICENSE.

The JMD format specification is licensed separately under CC BY 4.0.

Metadata

Release files for jmd-format 0.10.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 jmd-format 0.10.3
File Size Uploaded Provenance Actions
jmd_format-0.10.3.tar.gz 116.0 kB Without provenance Details for jmd_format-0.10.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for jmd-format 0.10.3
File Actions
jmd_format-0.10.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for jmd_format-0.10.3-cp313-cp313-win_amd64.whl
jmd_format-0.10.3-cp313-cp313-win32.whl CPython 3.13 CPython 3.13 Windows x86-32 Details for jmd_format-0.10.3-cp313-cp313-win32.whl
jmd_format-0.10.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for jmd_format-0.10.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
jmd_format-0.10.3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for jmd_format-0.10.3-cp313-cp313-macosx_11_0_arm64.whl
jmd_format-0.10.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for jmd_format-0.10.3-cp312-cp312-win_amd64.whl
jmd_format-0.10.3-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details for jmd_format-0.10.3-cp312-cp312-win32.whl
jmd_format-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for jmd_format-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
jmd_format-0.10.3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for jmd_format-0.10.3-cp312-cp312-macosx_11_0_arm64.whl
jmd_format-0.10.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for jmd_format-0.10.3-cp311-cp311-win_amd64.whl
jmd_format-0.10.3-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for jmd_format-0.10.3-cp311-cp311-win32.whl
jmd_format-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for jmd_format-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
jmd_format-0.10.3-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for jmd_format-0.10.3-cp311-cp311-macosx_11_0_arm64.whl
jmd_format-0.10.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for jmd_format-0.10.3-cp310-cp310-win_amd64.whl
jmd_format-0.10.3-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for jmd_format-0.10.3-cp310-cp310-win32.whl
jmd_format-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for jmd_format-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
jmd_format-0.10.3-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for jmd_format-0.10.3-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 2.3 MB

Release files / jmd_format-0.10.3.tar.gz

Download URL jmd_format-0.10.3.tar.gz
Size 116.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7930c92a7a9d41fd28ab580339a76e635b007834487ee6b6fa42269f3b4c5c96
BLAKE2b-256 checksum
How to use checksums
b325ba1d0ff7820d8772301e62bff3ee5cec8242077a956e12f8d85df6acfff5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp313-cp313-win_amd64.whl

Download URL jmd_format-0.10.3-cp313-cp313-win_amd64.whl
Size 119.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
ca7517fe8bc5decc94da065a53e4850b4c94f262ac0de22249a18af53190c91f
BLAKE2b-256 checksum
How to use checksums
f860b996f2de561ad0bc1c0cb4bea117deb5d50c770f06fee3c08dfb1ae2cfff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp313-cp313-win32.whl

Download URL jmd_format-0.10.3-cp313-cp313-win32.whl
Size 116.0 kB
Tags CPython 3.13 Windows x86-32
SHA-256 checksum
How to use checksums
3b172485387313e171ca9b1a733551862cd3d3cd78935447bf50d2005264c62d
BLAKE2b-256 checksum
How to use checksums
0c89a4ba982359551cd376f7127167d11d354d69408a2002e16bcc71b1510175
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL jmd_format-0.10.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 198.4 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
073b1ad0bc696247a9faeb9562973307d3a4a66fa10a36b1ac81461cf22448ea
BLAKE2b-256 checksum
How to use checksums
fa60dbfb64046956e2c22afaffea0e6e1fb2d4aeecb6880ef140ed8d287274d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp313-cp313-macosx_11_0_arm64.whl

Download URL jmd_format-0.10.3-cp313-cp313-macosx_11_0_arm64.whl
Size 116.0 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
14f62a55d1326f8b969792e9a24062aa55ffebb629f5c6c58ea397c49bfa05d6
BLAKE2b-256 checksum
How to use checksums
55d813fcc368143af78f57a8d77713dafdc2b2135679d8768fdfc76c41365246
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp312-cp312-win_amd64.whl

Download URL jmd_format-0.10.3-cp312-cp312-win_amd64.whl
Size 119.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
1a561985c2b0d1cd0139bf7ef39eff2544730b156a2f02e90755e5ec67986e12
BLAKE2b-256 checksum
How to use checksums
b70a2da8ebb77eda93dbfc8bd8a602f5462ef9ec982688b2a7cd45b0d19a58c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp312-cp312-win32.whl

Download URL jmd_format-0.10.3-cp312-cp312-win32.whl
Size 116.0 kB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
4d9399235e48f9134fc46e18c820a87806ecc5476132cbfc6f0588e4ab9cfca1
BLAKE2b-256 checksum
How to use checksums
b5baa03e64af9416ca91cd7a7b9951914e33b0e633f3ae991de2258faa4f3ac8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL jmd_format-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 198.1 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
905527f90d26445126ed229651f3967b0c8e7d7f03d4bee6a0e5d7890730dc6f
BLAKE2b-256 checksum
How to use checksums
1329568bff69ad64e86fa6da5528714c6a88ce9de35ae3e5cf1a347c9dff64bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp312-cp312-macosx_11_0_arm64.whl

Download URL jmd_format-0.10.3-cp312-cp312-macosx_11_0_arm64.whl
Size 116.0 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2c429e1d087b68437c9b71ea8cdc51e4331f8f110a194b6650eb95226903e6b7
BLAKE2b-256 checksum
How to use checksums
90423b6392edbac74ea36e591fa5301067d4ebd6757706dfa7a9397be768ed7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp311-cp311-win_amd64.whl

Download URL jmd_format-0.10.3-cp311-cp311-win_amd64.whl
Size 118.9 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
1fa95387860d8453a66a0dedf2179a215b3ae3e5622338cddb3f5b877bda3eb8
BLAKE2b-256 checksum
How to use checksums
7602d3d47eb5eb701ed9713b4d3ae74b7b156991db83b087442bbbfa6b1331c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp311-cp311-win32.whl

Download URL jmd_format-0.10.3-cp311-cp311-win32.whl
Size 115.8 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
5eb46a8103d7757198a76b9c064df27bec17e970c9fa43e3f19090789fb6585b
BLAKE2b-256 checksum
How to use checksums
82b0dead1ea91ba479976de66212b8b24e32875c797515a9970596ae422f2e0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL jmd_format-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 192.5 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fc939f2332d2108af1795997dd51bbf90a2f761fc017f3e95dc783be7214056e
BLAKE2b-256 checksum
How to use checksums
7835c9b29e08294cf47bdac46ae079125efacaa6cb9ee9a55928247b44bf8543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp311-cp311-macosx_11_0_arm64.whl

Download URL jmd_format-0.10.3-cp311-cp311-macosx_11_0_arm64.whl
Size 115.7 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3dbd635839c8df8b54de72e26f9d991b46351128f7f0e4a93452ba79ead265b8
BLAKE2b-256 checksum
How to use checksums
9d97e4fee09089a07a19ff6f07c4abdf68f6064852426828e848e790ee16a17f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp310-cp310-win_amd64.whl

Download URL jmd_format-0.10.3-cp310-cp310-win_amd64.whl
Size 119.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
e02bad1765199fafd55afe111585c02c8d1c4ccd4179643c86098b2251417571
BLAKE2b-256 checksum
How to use checksums
3b7a8d84e050a1eafabcb0f8a535b2a1d3e08b510648a0d5e702206d56f5d20b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp310-cp310-win32.whl

Download URL jmd_format-0.10.3-cp310-cp310-win32.whl
Size 115.9 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
9812da3a0157bf89f3b27b32aed8fd8c3be81eaa5e82742f46936861906de50a
BLAKE2b-256 checksum
How to use checksums
dac6544e7ba66dad4453697b42090e62811689b7393546b7da6fcfa8fb62e5ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL jmd_format-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 190.1 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8027d8e5224ebeb16703ff88c3e638a11b6248d145f24f498ba20660f0e7b8c4
BLAKE2b-256 checksum
How to use checksums
cadc1601d163cfe2d77d1e8e08729c5d2f5661c6341d02f4d5662499d1221049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / jmd_format-0.10.3-cp310-cp310-macosx_11_0_arm64.whl

Download URL jmd_format-0.10.3-cp310-cp310-macosx_11_0_arm64.whl
Size 115.9 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
456fe3b1f8cdfafdbd4c8682cda3d420c956203b0e234abd0f64f145fd4680b2
BLAKE2b-256 checksum
How to use checksums
fed81c4dfb749f3b33e9d67a289e1095d20630f3a3f61933a5e299f22fde4088
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for jmd-format 0.10.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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