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.7.0.tar.gz (101.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.7.0-cp313-cp313-win_amd64.whl (105.4 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.7.0-cp313-cp313-win32.whl (102.9 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (190.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.7.0-cp313-cp313-macosx_11_0_arm64.whl (102.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.7.0-cp312-cp312-win_amd64.whl (105.4 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.7.0-cp312-cp312-win32.whl (102.9 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (190.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.7.0-cp312-cp312-macosx_11_0_arm64.whl (102.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.7.0-cp311-cp311-win_amd64.whl (105.3 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.7.0-cp311-cp311-win32.whl (102.5 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (187.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.7.0-cp311-cp311-macosx_11_0_arm64.whl (102.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.7.0-cp310-cp310-win_amd64.whl (105.4 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.7.0-cp310-cp310-win32.whl (102.6 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (188.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.7.0-cp310-cp310-macosx_11_0_arm64.whl (102.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.7.0.tar.gz
  • Upload date:
  • Size: 101.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.7.0.tar.gz
Algorithm Hash digest
SHA256 121d3edbaf8ab2e132e998f16b755c3ea90ccea26e94283eca4d2fb2730d721d
MD5 7b7fa57b72524a3fa5d86d18aacc1581
BLAKE2b-256 05e2b896332a137a09422399f329d80ce0a2824c047c1646405b688ba2d386de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 105.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.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1a715aacf2a3949b55dbd5c30046f38f47029955f5593870e5225a16464605c0
MD5 1d61ee02d32e1f8672503ba3c4b30723
BLAKE2b-256 9a081f45018c64a2aab93350ea2ba6772eb01b16a65d11d4a2ac0c8d976edeb0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 102.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.7.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 b39de933e9abc14b0fec9b0c843bd5e28cd10f6611b3a6a14e8b4584cbfb906d
MD5 d6a0db59b0cd09541e3b7331a8a0f994
BLAKE2b-256 f2a7df90b09b3f70d23a70dfaa2c3197c51dde1cf841ace22bacec5dfcb0d6e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b70bb95bb459b355e8e0d98cd019196c1019cf82adb06534939bcaa5137e8d1b
MD5 a399bc14970ab9b19a7f6d70b28f9165
BLAKE2b-256 2f6a5824d651f26d4fc0e87a9af78474dcbad7eed263330fb4e691176458214f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 035c64bf8d7416ded937fdf328edc113cc90cbec0942b20bac134d619a550376
MD5 54910996d8630a1c8e719f3c17453eaf
BLAKE2b-256 fd7583bde4928ea171517c1241f8aa82160fc270c21322d3d0693820fd6c54c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 105.4 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.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a4fc3455f184891784e772f066ed9a96a44bf0ea9883828c50268a67de44e5c2
MD5 76886cae6978be59edc7c98c86799a49
BLAKE2b-256 ca830d7414ae188cc42a5bca176ecf9c3ad1364b9ea7949504a62d5b5a449c34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 102.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.7.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 55a2f1102a5bbc32e44146a0b7db284fa24d223f1e83abbeba966f46fa21ccc6
MD5 a40adfe91170bd4420572688d57d780a
BLAKE2b-256 44aceac7f171aee0815de94355c874cd7319a6d1c5f066f2eefe8d3d617274b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7751d83a20d95427fcbff95b46d39e255f672501917caab4e305b3da79889a37
MD5 dc8cb0b4a788c26c6f17e99e3bbdda39
BLAKE2b-256 bb4ad8813c6b106f97934510760e3580f0e1ee389dcc86cb5f1142e4478f1925

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d14e48b95b9501103fdbe632f51c5c1341ef2103f26803b4de519e6a2b08a05c
MD5 74ff6ada158859200b53c2303b165f7d
BLAKE2b-256 3b6b035cd0d2af49fe00bb32707536789dc9b89e8ce884ca5bcc56e6a050149b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 105.3 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.7.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 80384fc8aa2646529ad6183b6478133c00e0249051b2d355c0d8856e8d7fc71c
MD5 db0fc65379ee7add8672a040c43e534e
BLAKE2b-256 857d495afd5f69dc8d16c494abb1207236efa454417b01755c1932fbd9c87fe8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 102.5 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.7.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 19a0534e2364e8023cab63c92847d612bfe5b94dbd98b7d1883e60c4a56a2667
MD5 91083589f0585e0ba0c6d6c00d83e6f8
BLAKE2b-256 15831cc866de8d05a0660027fac6eac203df3faf2e2d7e807dcad159009ddf6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2ecff89c0054b482610c7a8a3b5a2c7b0093eaa238d30465dabb7f6c6107eac
MD5 ad3d4746f7a24932699d5fdda64fa2b4
BLAKE2b-256 26569bf860996f57077dab4645c492e33c4011ea89a2b089a3bc12c22c3f7d7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb9f1c0c3a0a9b243e39f6e212c027e721d9e2194f96716846c2e4ca14bb916e
MD5 747dc06122c8a0df0fe9709fc659ed26
BLAKE2b-256 7de173d7f07eb1a59a52879171c0b66700993429f6763bfd4cb289f4db251399

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 105.4 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.7.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 53d3c7b184ce3727edc625fbecb99114a0f5e4b7ab38dcb19329bce9f9d49f93
MD5 97b1a451b8c17164a37aaefde3d3de3e
BLAKE2b-256 4953a582c5a33c6ebd7aad0877f907b0b2f339314255a8935e1707f70c8f81aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.7.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 102.6 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.7.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 643841d4064b133ab2c622cc6e6c84eb9224d929c1ea6e326594fe82ea696cf2
MD5 2c33c987468f7fc39854c73780fbd31f
BLAKE2b-256 8d2fad072de5f80988a3c648271b333876d9c61a235d90ff2288f53726286e51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 13ce449181dc75be951efae13fcb67b32b0899627bae47bbd58161b64c8c653b
MD5 f839e13ea9da5337c9dfebbb467bb99f
BLAKE2b-256 a61b3db2980904401bc5bbe3b5c5797cf4e02a10e6a202048ea6f2231a8596c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14ebd4cdb692c1b2e6688a19f4bf03efc8a99b85c0c3166c74a0cfeefe613987
MD5 04bf63dba20e421e4c88cd19711fb1e4
BLAKE2b-256 d5a540f614038266cc92811b4680fed4b120909e9976735f653508d146595984

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