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 MIT License. See LICENSE.

The JMD format specification is licensed separately under CC BY-NC-SA 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.4.4.tar.gz (64.1 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.4.4-cp313-cp313-win_amd64.whl (78.1 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.4.4-cp313-cp313-win32.whl (75.4 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.4.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (145.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.4.4-cp313-cp313-macosx_11_0_arm64.whl (72.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.4.4-cp312-cp312-win_amd64.whl (78.1 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.4.4-cp312-cp312-win32.whl (75.4 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (145.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.4.4-cp312-cp312-macosx_11_0_arm64.whl (72.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.4.4-cp311-cp311-win_amd64.whl (78.0 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.4.4-cp311-cp311-win32.whl (75.2 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (143.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.4.4-cp311-cp311-macosx_11_0_arm64.whl (72.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.4.4-cp310-cp310-win_amd64.whl (78.0 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.4.4-cp310-cp310-win32.whl (75.3 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (143.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.4.4-cp310-cp310-macosx_11_0_arm64.whl (72.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.4.4.tar.gz
  • Upload date:
  • Size: 64.1 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.4.4.tar.gz
Algorithm Hash digest
SHA256 7c1d7566e4dbcf9a9ab338a68300889ab070a0f84e0d1358bdfd96032af5ef04
MD5 fbee4dc7f48a46520079cd89d10a2099
BLAKE2b-256 74d938c5198e4d5c1f22171cd21da38b83e4e09b1043b51fa905d7a2c3da0de2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 78.1 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.4.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e8419c943404262a490614445f20f117a84707e38957ea708d08593990508aeb
MD5 0ed187373b7ff69e45942927e9d73ce7
BLAKE2b-256 52c6834fe633a0d517cee9a88b51bf71767b96d55f2243c0a81fc0f1c9aa3391

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp313-cp313-win32.whl
  • Upload date:
  • Size: 75.4 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.4.4-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 0fa825de283b88f38becb619c7ba051fd6cae935d8e018c048aa08824b817a7f
MD5 cd9004117ddef7b415637c88df07d3a2
BLAKE2b-256 49c69c81fb2952c47dca164e7c67bb7e8903ab1ee3013d670c8e08701422b13f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41040eb2300c41aaf0563e25288cf4fe39778e26e38dba033ad675a01a4c3721
MD5 45ecc803db3356967ed775853e3a106f
BLAKE2b-256 9b5f164959cf17f7704b964845d6be0e4255cc13fc9317b947695723270c04fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7aa5f52354b5c1e344bb6b1b267199c6aea1b1356d850f3f71541ebac097ff0e
MD5 0f86a07d12a42aa055edd206ef7acc6e
BLAKE2b-256 06ee962a694d194fb7a97733175d0fc63201eaf0f771de073ea8c2e95d3c2dd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 78.1 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.4.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3780c394a0df08932028d20d30fdbbacd5ffc34c00ad1c578d948acdb8f09e3b
MD5 c8da034146cac80860cedc7d9dda0344
BLAKE2b-256 02f744e507e2df969b1413a448fa4409129bcc6da6805d3f95ac376e8ea93400

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp312-cp312-win32.whl
  • Upload date:
  • Size: 75.4 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.4.4-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 0001c1b47a0eab082a82c209cb2b1a1c4f239f16b3305292abc0d88953a7b9af
MD5 48814702e95614a78bc8fb00959660ce
BLAKE2b-256 96ff4307ffe2dfe11a6ecfa1bdbea47a9338ed7856067fe0e953ca6c5f194dca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1aea7174f50433caff37323b72dec42260efa41ae16765db38f2a2aac59e6d8c
MD5 9e203dc171b115fb2677eadb28cbcb42
BLAKE2b-256 a4c6c0b065e24f287a09692706affdaef0e5247c5fd23c42b7dc6416b9340dd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d9966b983c941d75b6a0ee3020f2c743e2528440b958f781f450125c3510ed5
MD5 be7004630aeba8bccc92c45ba3bd922c
BLAKE2b-256 84867564a7666a38b71121b83ff1ac619b58390077c061eb0913742e5bdbcb8f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 78.0 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.4.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 159cae3800b549b8ddfccbc4f1bc560dc7b07d4171d9db080b6afc93033ccfb7
MD5 d6d9609e45aee690a174954d58e1ffda
BLAKE2b-256 bfdf267cd53b7b632403ac4a8f571dbb5eb0e99890e34d8ab7178de758540b78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp311-cp311-win32.whl
  • Upload date:
  • Size: 75.2 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.4.4-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 18f1ffe5ffca198c75de1f47b82528c8dd5158d6155db5754cb979529c91587f
MD5 e02ae7c3a590e3bfb3320f90f66f9a5a
BLAKE2b-256 672163802316c022eacbb21fc444b61fb34a29f56b66e0ca770e1047077e631e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee72a9ea44b2873e0ae54ecb755d973f8067cb64a1004b640b99c8d95678d918
MD5 29e15a40de60449a6aebfc2c1b47620c
BLAKE2b-256 e4ea16bac5da4c42afb953269cd933e85440c1a22aeb51e993918438a0254d63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 750d8c2f9d3222210da78b6cc33913a5d2faede5db5e60ff0a64fddd23ec488a
MD5 105fd32dacdf06e598f305761e2fc290
BLAKE2b-256 6dfbdfc4b5a22a43f749f9096aeda77631f0e68cc612f1b8aa12d64ee11ed3d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 78.0 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.4.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dd1e5f82557b18ded0a42add404fa648fe7bbb82403b0a87f3a87bd542ac8673
MD5 22256511a42f91435eb8183eda66cea8
BLAKE2b-256 866ae26e65b1737d97f4b011089691c1fa0d381ea91834e587a50363765f6de7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.4-cp310-cp310-win32.whl
  • Upload date:
  • Size: 75.3 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.4.4-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 f0d14236ee2b5037ddec4abe65dae34092966f3d1aaf978786de53ffdf20d774
MD5 ebc5f7405cbc613fa2c99fd915890a74
BLAKE2b-256 8cc06795db811d71d438f076ff569b4860dca6aeb0f7a420a30fe17ec7c21d0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f0a69e2ae016ce66fb8db556a5fe534beae4220c93f58c546ee202b4a6b6d4dc
MD5 d66a14adf0d9b2dedb26127f695b90bd
BLAKE2b-256 7940562e35d8aab7ecb67bc5286af4f9d6fb1568bd4cee844460e63be40e13ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e518bbbdb7f987a294cf036abc06a73508e272049d0fde7119706e63d0a08214
MD5 c4cacf3a5ae18f2fc2669eb70f5ab8cf
BLAKE2b-256 4fd53992835a625f518168806d5f56680e64b274abcc0e621ae8dc9d36c713bc

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