Skip to main content

JMD (JSON Markdown) — structured data format for LLM-driven infrastructure

Project description

jmd-format — Python Reference Implementation

Python reference implementation of the JMD specification (v0.4). 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.4

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.4/jmd_format-0.3-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 jmd_mode, JMDQueryParser, JMDSchemaParser, JMDDeleteParser, 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 (#!)
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

from jmd import jmd_stream

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

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.

Project details


Download files

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

Source Distribution

jmd_format-0.5.0.tar.gz (85.5 kB view details)

Uploaded Source

Built Distributions

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

jmd_format-0.5.0-cp313-cp313-win_amd64.whl (95.3 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.5.0-cp313-cp313-win32.whl (92.9 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (174.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.5.0-cp313-cp313-macosx_11_0_arm64.whl (91.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.5.0-cp312-cp312-win_amd64.whl (95.3 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.5.0-cp312-cp312-win32.whl (92.9 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (174.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (91.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.5.0-cp311-cp311-win_amd64.whl (95.1 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.5.0-cp311-cp311-win32.whl (92.7 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (171.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (91.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.5.0-cp310-cp310-win_amd64.whl (95.1 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.5.0-cp310-cp310-win32.whl (92.8 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (171.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.5.0-cp310-cp310-macosx_11_0_arm64.whl (91.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file jmd_format-0.5.0.tar.gz.

File metadata

  • Download URL: jmd_format-0.5.0.tar.gz
  • Upload date:
  • Size: 85.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0.tar.gz
Algorithm Hash digest
SHA256 094a213c7a9694abdd7e7356b3be123f7c9340f40bdcf4113200b10b805e26d4
MD5 757d262e5c3f11208cad49cfeecf6124
BLAKE2b-256 13f1ef50dbe5ac065580b4623ceda1a128886fcb80bd8b073254bd9f01b0772d

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 95.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f9b9d25c192e6a00e5d692f27c177a5cc3aed28867c2310275ce4f9461bb2056
MD5 2293d9188fd294860cb301055de216af
BLAKE2b-256 a810c3f59b25e84848f314d13fc1391f0bccd3c3cbb1f26d6a617e5789885e99

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp313-cp313-win32.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 92.9 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 ee5b4d7379b8d5dce2089fd893ede93862ebfb5ce7554e71ad1edc67e7e5d89c
MD5 b49b21edddc741809e59c392da3896ea
BLAKE2b-256 369282f9fc3c510939592a06a163acd2ad189fcf0a35a9ab9deb1b92d2e1ea84

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6b552a88bd98f7af561bb84a5a37985fa4ef8da865ba201a1790eac7ca3b88f7
MD5 7cc13e70d652d5ed6422e38dce52bae1
BLAKE2b-256 bb575e719d5810b63a9fd8de12b1ecf3d4f76ad8f95743ce9d02f8c928795b3a

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b80dfb2f09b7e94a8afba99f85af62c7f15b81caeb19f564d0999618735b793d
MD5 7e21858e49e28027c698b4de06e54073
BLAKE2b-256 7164d92aa47f8b6d2b4774351e452d8173d65a12e32cdadf30af810c797a4f1a

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 95.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c2f7999bd5b2cd2cee5ed712903ab246228822b95db4ec4df46a566fbadc55cb
MD5 18bfec21ccb1fb1e450ee2ff5b3c8bd7
BLAKE2b-256 990e33a3ac4a4dd1d3dfe09223c109313ef68b49792e05109efa799bac9b80de

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 92.9 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 37dab721e8da6c4db1ffcaa3bc1eff8f99778e44d9cbe5633892fe3d39e3fc73
MD5 75172056052dfd97c262997d08f8379d
BLAKE2b-256 94bdd3fb79c998fa1b178f2ae95a397bd35036ffe3c4f08a8b1e94dc162ea8cd

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7088d5a54d370a2af5db1325f838fee22887be2a6d2f221da2221800a1c42ef6
MD5 3455f62064f0d67403990e7bb8fa4b62
BLAKE2b-256 6a45c555a4e444a571ef21bf71290d1995a550385ff5f084d70661edb9030846

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 272e5d106d586e0ea17e4e4929d58034bad183ca1b1714ab2bbbfdd7cad7e434
MD5 6e6ea9833dda39fe4e5fd33a046e0d9e
BLAKE2b-256 dc37da967656b15809f3d55a324c63617893a2fbd3e08988311db83384722baa

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 95.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1b7d032176b143cb569501c854dbf93e2b86f7f442f37ee7d1e1e25e4f32c3ef
MD5 13b707167869cc23ed5d2d3878c38163
BLAKE2b-256 82410cfce17593eef42d1dae5914216dd5e5a2c61c354f56db53eea2a948b6aa

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 92.7 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 49bcd97fa502317e25c376fde8e87f92ed0cdbef0463b18676d55283fbfbcdc6
MD5 d480760bd2ce7064005e2d5d251ae5f6
BLAKE2b-256 efe9f3b5d6edcd7f2a7cd837529c4465206ba4ab26073f487995a388e905a75d

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 913595c2568c45e422e8612a1682feb0b333a1bfce44c62e27d46cb74128150a
MD5 535d7ff1b42ff827c14f5555ab88d9cd
BLAKE2b-256 0674d6503fc1b6675a61d24b3b1116c76de1417d217c5a0fe3829276426bc8c7

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b89cc0e9d3fe8d1b46c08d11a76c0e7db74db2acc5adf99fe7d4a8062c40f63
MD5 04d49757255f0ed28c190ebeaf3dbf55
BLAKE2b-256 234b52518a9448fce3ce100be86c60583439c3d9fd5a12a48d1ac23e069f8c20

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 95.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 364c4c221763d1094edd73a205c47434712228f1fdd8715df0891c0dd562c727
MD5 225155f1a35931c5eaa5c47812f94dba
BLAKE2b-256 2c00b7e61c1fd8ca5ea0e049c5cd71a5f369c33f052ee0f04e692c25b385a174

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: jmd_format-0.5.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 92.8 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jmd_format-0.5.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 a4860d58dd80c46b1f9ee60ef0a48f1493e527f29a2285df8510470cadf8b9ca
MD5 78b644561c13ca63e5bbe478ce194d62
BLAKE2b-256 3b94178f82c2ba6f178614b7fb5bbdfe6a687d3a1fd9c051455c5b3a21bc11d3

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c902fc26134f6ada5874e21f22a28346efb5fe20c983c0fb6590cd2e0866445b
MD5 60c4d0c1dc01f32c8a7a9bda07777374
BLAKE2b-256 14a97b0794f49dacce1deea8b0dcabc3f480ae23217aff5a809dedbef0f8e1f9

See more details on using hashes here.

File details

Details for the file jmd_format-0.5.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jmd_format-0.5.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83372cab9c3962cbcb90bd6cffb2d55f7eff9c86017a526d6fcab03d675e9cac
MD5 95d062c6fb50ee819a0b1bc084d4f232
BLAKE2b-256 49ac5de62f18fa98cb700e2a5a87b8e6c9697f021e60ef179324de9a6cbb02d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page