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.3.tar.gz (63.4 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.3-cp313-cp313-win_amd64.whl (78.0 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.4.3-cp313-cp313-win32.whl (75.3 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.4.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (145.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.4.3-cp313-cp313-macosx_11_0_arm64.whl (72.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.4.3-cp312-cp312-win_amd64.whl (78.0 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.4.3-cp312-cp312-win32.whl (75.3 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (145.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.4.3-cp312-cp312-macosx_11_0_arm64.whl (72.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.4.3-cp311-cp311-win_amd64.whl (77.8 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.4.3-cp311-cp311-win32.whl (75.1 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (143.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.4.3-cp311-cp311-macosx_11_0_arm64.whl (72.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.4.3-cp310-cp310-win_amd64.whl (77.9 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.4.3-cp310-cp310-win32.whl (75.2 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (143.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.4.3-cp310-cp310-macosx_11_0_arm64.whl (72.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.4.3.tar.gz
  • Upload date:
  • Size: 63.4 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.3.tar.gz
Algorithm Hash digest
SHA256 090c611dbcaf552374c61dff286fe341429e6694ebbab247710858420483195b
MD5 05cf39079230d0ca6a4cd270b4028295
BLAKE2b-256 2cfc9a8ae35bdccaace621a8c149ac5bcfd685043a6ab04e887972ed317bc81e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 78.0 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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fe07e97d1ac07a439400739511be11ff762d7cc4e63c21e7a502be9fe6fb9ab0
MD5 27a6e9bf27ca9d6affe4035a5b2f4fdc
BLAKE2b-256 c1475b655983093420a25bfeba6d2b9d777d8e453e0a6ee750a79e1e917f86a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp313-cp313-win32.whl
  • Upload date:
  • Size: 75.3 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.3-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 7a7d928a362091c3ffb49d75b73f12ff87b4d2ee30c5bbe6506687e942cfbb56
MD5 6d13367065b29bc38e6d658b88958a7a
BLAKE2b-256 5d9f56ea71a5d78a1e6e323a4e8a19267ca155d4580d3cf26c216cdbb44968a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 269672b120487dc354b41c6614a1f4fbd07e39f8e18ee9f48066ed403ea305d0
MD5 68c50085b5d84c459d752f5ed377f00d
BLAKE2b-256 e56646eed8e633d762daa932946890834894eee5bee171a50377e8ec0a23dd85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3b5e2b1dfd65f2d4934ca775faf9f4fe7842f0b19dbeab922f8a6838db2b025
MD5 9e55af24b4bebf73855e9d7b3c06f174
BLAKE2b-256 8cf5b48a32a32949e91c9a1aeaa9b0938f2c28c6945df278b2e75d4f1dc53f6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 78.0 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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 24c6cab0d7759b51efa4bd8904f95bf02b439097a4c9a4ffb30b6dc256a23a61
MD5 3740f1d65c0a3222bb315f5c7890eeaa
BLAKE2b-256 0f84dd96dfbb5371104861e5ed764d42ad7889018f71b0f163670e152d86ad95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp312-cp312-win32.whl
  • Upload date:
  • Size: 75.3 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.3-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 ad43318e114a94089c0076a71c311ffa7b02a59459bae37d44cc8ed55f5b90f1
MD5 015d425ac01afff5d004f8bc1be70565
BLAKE2b-256 decbe9b4d3cb9858b27309682594f4fdd479499cf6797c72a501d873d4fb0ddf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7019230376c25355092ea6a8eb7f800d00e28dfdef2b41f72bce3cf889ba28fa
MD5 8b6f85f31ee0cd119fc6c1b0d52b88ce
BLAKE2b-256 41d0a0c9c561291ad4d16283a112ebd44e84d13bdd4c566e5cd8a602fde5a209

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31bcb3e4ef98afa6cc5b81f8d67fec85f73d6644e74e04aceeaaf8dc54623793
MD5 c379618746d53ee076b0a04c57f95ed1
BLAKE2b-256 6895632297561886eb29a9d9ab015ba5639be04578c71acd02c83d75b111bc64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 77.8 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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 47af0cc310936d048d988754a83910c22842667e32168c597ffe94aed703da19
MD5 457cee84555605d8f3431b7ecea719c5
BLAKE2b-256 3ae434266e5b7d53522982b2164cad5734ccad9cde1142a6de11c64acade593d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp311-cp311-win32.whl
  • Upload date:
  • Size: 75.1 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.3-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 28432e2df1730b0bd4f05e1df0af2a16a29b637866b78b7108e9489ee8701081
MD5 1dbbf36f858983c0005ecc9de2f385a2
BLAKE2b-256 b5b15b547cca14ad8c0b963855c002bf31b405dd3c4beb5cabe7bbde04f4c9e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0d2803d62e1a5bb72995d15bb0d88d618b8a5ab03aeb68f43549d8512d5a89e
MD5 6fe22ed1f619133314c7ef9cd6921cff
BLAKE2b-256 c09831f2c8864cf59dd94bd8a559528d9d6a31384b060b47ca3aee6062f0fe82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec72838ee00d89d6d70afe1af43c4a6f00d39e36d1e767b197f95aeb4cd786e3
MD5 92c2b577e654545bdb391d8099665ec4
BLAKE2b-256 e0a9de6a70c68fa69be76fd429079280e149fe5170787b3e869e79b5fb4cdd98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 77.9 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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1013a110d137362ee8ae7eacff93fce21644b38facd22701786d0b5dc911f01e
MD5 6ba1684e576ecfc091d247234c4fe824
BLAKE2b-256 805e2fbd2083ca02e6c7efe85c536024fe8df6ba1d4efbd1892050fd7346eea7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.3-cp310-cp310-win32.whl
  • Upload date:
  • Size: 75.2 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.3-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 4bf31a535d8cdf12af43d060d462ce86057a0b7a946166f9a47ac152bd01fa69
MD5 b17a5286aaff768c3786a6625ab5fa38
BLAKE2b-256 3778d3dae85562eeac091bd859a19b2a8ee4f6d6d241488bb088689706f65c79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9e25771b789ce3afef1af92e58709e95aa5af7c5fab64becb1ec80a25f25fc4
MD5 9e26ae7e8f9a71035c85104acf450fe0
BLAKE2b-256 ef144c08696683045ac35d6fbba2df31c13eff3a18b527dd3aa583a4b05c4605

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 72b45a19993d824221e7f19788ffb841cd34030548042938cfa681c1cafe5b97
MD5 78caaca39294646c9ec90fa41eacafd1
BLAKE2b-256 2a14f95d9dfe07035a97a32bf30c392f9e696fc75fe3171fe006a2cc4218631c

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