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.3.3). 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.6.0

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.6.0/jmd_format-0.6.0-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.6.0.tar.gz (93.2 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.6.0-cp313-cp313-win_amd64.whl (100.4 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.6.0-cp313-cp313-win32.whl (97.9 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (181.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (97.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.6.0-cp312-cp312-win_amd64.whl (100.5 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.6.0-cp312-cp312-win32.whl (98.0 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (181.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (97.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.6.0-cp311-cp311-win_amd64.whl (100.2 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.6.0-cp311-cp311-win32.whl (97.7 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (178.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (97.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.6.0-cp310-cp310-win_amd64.whl (100.3 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.6.0-cp310-cp310-win32.whl (97.8 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (178.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.6.0-cp310-cp310-macosx_11_0_arm64.whl (97.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.6.0.tar.gz
  • Upload date:
  • Size: 93.2 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.6.0.tar.gz
Algorithm Hash digest
SHA256 ab86563d4ab4d1f360ad9705724262fbc2641daf2284dea879fa9ac4de543a4d
MD5 eeea34dd11e889f87230f0dc37644c36
BLAKE2b-256 e276664fd42faf60c3d63f9ba972b73aaffb28f101cc35977524b6a858694697

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 100.4 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.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4fcfa7f0252aae39d7a49e4f5b3e553c4af73736735e724afa8f4b2f46d0a0e1
MD5 7d03d3b83dfcaec08c42c16325a45179
BLAKE2b-256 a15462286d0dbfb4b172bde65a80b021cd9164c02cc9742a1affe2155966f437

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 97.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.6.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 d9841d421e25f7c35d43fdf402676642612c8b364b272497114d0a6e9559e3ea
MD5 b52206db2f15a698a3447dea662f6fc6
BLAKE2b-256 4d708d19788bbf4d488bdbc9ef967fea10b4eed42946e3dff247b712fcfd7883

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 364272157bb398fe709f37884415dfca7ecc0c03d204d7df5a1783758098570e
MD5 63709a732924cd0910812e752194a203
BLAKE2b-256 b4aa662ea818b7114d6d6d5c17b5cd6a12f5dbbb42503b68aceba62e5aa591b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 576df76a52223d3235f5de6d8c3a72fe54d2d0be9f7da2d5df6e8ec75c246d4a
MD5 ac6ff1d495ae7f4d36d6ab6028f302e2
BLAKE2b-256 83fcf2dfab5f2d0b0ccc4049e45a6d000fd2191baaef2f411847b8d1c0383eac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 100.5 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.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 683f30b9628ddd80cecfd815bd1cd33ade7364185a63452d270a9dfe323dc10e
MD5 db8cf1afb1bd13d680b0ead60d42c482
BLAKE2b-256 b98395485b14ffd40c51d8f481159c48dbd18f4d3255cc04698ef7d948742066

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 98.0 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.6.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 491ed1229e1b0d3d5243e6971e2be5fd8163ef058e4d68470396f8613d13a02b
MD5 b75f6a54513a68476dbb80295365227a
BLAKE2b-256 f6b56017590c1e4c63dd159506d57c6f1646b6894513d653e08c7175ce991dae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 612e2168f7b143ce2d47bc06827bb771e95b81e55581bf0c052bcd6830993c95
MD5 ff79a467b85ad9e2723699cc5472a9c6
BLAKE2b-256 bccdf04e54a5e717808395eb6c521d671f6a9d990c2d763e622bc21995dffb3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cab49ec064ae5394e51fb99ac6966ec15496af2cfbedff69a82a32fcc81c7bef
MD5 1f9de15e0668c4dd040ea1b3994e1287
BLAKE2b-256 f68711daf00d67c46373e3fe10fd1aea2d984fb77237f6347e50116ed0996408

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 100.2 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.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1c137ea0c1dd53e0d0cf67da583fef3d3c4a992e002f155db7dfe30002c6e722
MD5 6e13d616bf5fda2dcd1e4b46e98a5a01
BLAKE2b-256 78deba794d5d12677e5460636b7e7e57656fed9c2747637f08806bb0a929b96d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 97.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.6.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 b1d44900f5b1684f9bd88ba16db3e0911fd18c45e7c71a8068d2ee42e50ca9b8
MD5 d008ded1a041f6d0bef2b554049e8414
BLAKE2b-256 d7eb981cf9b540810f83b57cc90d8a24f58e1ef77bd7626a5c1a70dd3185c267

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a3b7f8178a2b06f6f9e3a74734d70b4e37b2451656135809b2089871f09212ab
MD5 58cc6323ecbb03a2c6797908de35596b
BLAKE2b-256 74ddc29640c580b300085c501dd3c9d7f657b38773ecbf3c59fa17095ee56080

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 36561054585601fd6e343b1fe05ecf34524aa7456232cf17bcdc1c9b8adbfabd
MD5 3704f3023c5e4e7b0c2f0291ca155b5b
BLAKE2b-256 58a946df4310cee851ff29099797d76c3964da2dcbfe8a9fec48597c57f53d8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 100.3 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.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4be377b5bafe30232beba104c13074c3324ce6c4d89a4aa7b93182b606f1533c
MD5 bbfc7ed94ab491c1facc7e8bbb93caba
BLAKE2b-256 1c68d8ca542869142ee8dc0a5f686816a09c6095d566f0cec8ef9a1692fee87d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 97.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.6.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 b5f15b348fb8eb62b15c5e261ef309a34f6f43330d3a42e9eaeb6f0951988511
MD5 f812eecda79ed4b21cf4386bf33ec6f8
BLAKE2b-256 dbe76e184e8501892389d54e59d2250a609e40d7fe8986ac1deadf1aa0b2e8e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4f86ad58b23218842f7fdd66fdcbc6458fc853e3f0f687482aa2b04591676efa
MD5 e65dc901f00b14e7fb6acc6104af3020
BLAKE2b-256 74dee3e0fa030c1eb83e06f01a43f4a10419eb81d0f62171479f3b4e9fb0021e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04dddb0d8e1910f897941b19d6bdf0f0dd640a899b697ea9f566e85d03327414
MD5 adbbabfa402377d9b1b6e4e5bbb462e4
BLAKE2b-256 563716435ffa224835628be9f574c0a388fd2ed640020618502ad6b94bb68bcc

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