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.2.tar.gz (96.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.6.2-cp313-cp313-win_amd64.whl (101.0 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.6.2-cp313-cp313-win32.whl (98.5 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.6.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (180.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.6.2-cp313-cp313-macosx_11_0_arm64.whl (97.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.6.2-cp312-cp312-win_amd64.whl (101.0 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.6.2-cp312-cp312-win32.whl (98.5 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.6.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (180.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.6.2-cp312-cp312-macosx_11_0_arm64.whl (97.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.6.2-cp311-cp311-win_amd64.whl (100.8 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.6.2-cp311-cp311-win32.whl (98.1 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.6.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (178.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.6.2-cp311-cp311-macosx_11_0_arm64.whl (97.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.6.2-cp310-cp310-win_amd64.whl (100.9 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.6.2-cp310-cp310-win32.whl (98.2 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.6.2-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.2-cp310-cp310-macosx_11_0_arm64.whl (97.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.6.2.tar.gz
  • Upload date:
  • Size: 96.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.6.2.tar.gz
Algorithm Hash digest
SHA256 2dec34edc58f4b5ee04efd7a55e9a5334d2b009c63f9067c3a74a05b4237c0a3
MD5 8c22613688e3213d51a4c9c91fba89dd
BLAKE2b-256 04f0941481392ef1e843d292bd65aee88e4923169fd5bf11a5f9bddf4a62bc7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 101.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.6.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c019224933eabebdcc04a510baac36556ff0d2d19ef0a0fbb7b255c57e9a5ae2
MD5 c471d0dec0623c96903b3d79d1df3c99
BLAKE2b-256 92be223786a277178795debf935f44ed979739efdcde68e19d5242d7643e42f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp313-cp313-win32.whl
  • Upload date:
  • Size: 98.5 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.2-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 6645ece9dd09f1c5ec23221b7c2eb7b93ae1d6024c22b2abd197dec5512ce502
MD5 4bd412e627e8fa8d0c882632977388b5
BLAKE2b-256 d1047d41d3eb04825aab1d7cdf1d199309ee63fa6279b734874ed899c9e2a6b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37c07e9cf29cbd0138e1e6b659f80615532e4a9163f5c51ac29d2c850f75d3cd
MD5 e24dcec0f170f2393b4037b812c64da5
BLAKE2b-256 64271d4019baf56355b6d77c2390a6439fe5609c2ab7b6c3d8255959e46aa045

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c76ce598061aebe10de1b129dbe2887f6e38becbf8d4db9883c333b13b93662f
MD5 0ad6c77ea6fcdda39ce4a1f3cf14d13a
BLAKE2b-256 9d3d7a19b36e789e841f0d401b2dea836ccdafecf9a83d6210b67f688e756a76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 101.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.6.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5d281776c4d52f25877457e4546bf632cc12b28dbd26bd207ad32d84b11c8131
MD5 46db37acdafb7c5a525256462c34f458
BLAKE2b-256 0343f8295cf628b1d8552ba6fe1e0e5c777e31935388f3f3880e2a9bf4015794

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp312-cp312-win32.whl
  • Upload date:
  • Size: 98.5 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.2-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 97f9f17c95455c00fb95129148987fe4648f484e8d91aa6328a02dd5885dc895
MD5 3950e07f43b45ae27560b938fd9fac89
BLAKE2b-256 181e0bd7fe55a5af3ddc74c73bc3ce8054bd9fc370e3d51143e9db801946beb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef04956a398d842ec3697b1957ab47593441174f30977ef07ecfc07a5ddf6e9d
MD5 11b623d2421e2142ca72133820559e77
BLAKE2b-256 882a2174628fe0fee33210fe84a06514750964255d73e9d362358fe5509dbf5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30533063c395b4f102bdb9549b11ece20cf3b7bb24f4c8288ea060403279d471
MD5 b43d87cbbe4c318cac71851d7daf58f3
BLAKE2b-256 dfc32138ca82af1f18b242cac9630090bf8a6beaf6c75b2fc1e8d9c34962414b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 100.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.6.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 84a1fdc86d26d689b2912ef21e134570f3223064c4ac04af76401670585a99cc
MD5 8ce8b5e90b2cfbef99755377eee131f0
BLAKE2b-256 dbdeb33389db49ad120fa99e5d3daa76aae16cde5bed0aac4d178444b26289b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp311-cp311-win32.whl
  • Upload date:
  • Size: 98.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.6.2-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 a8a0045c7adbc813a30107dab5bfc5b9c0b2d7342a273f8833d0d9e5419899f4
MD5 66adad0bcfb7ff01ac9b035b39472981
BLAKE2b-256 561090e0a2f43f664ff7bf8c75f16236d212ca1c5e3cc90187db12f9c7303a0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 58193aa8ae83ea4f9070c606910d217b0d3dd94a90ca59ca969fde87a33c82ac
MD5 27eb5dade541d69cc1744a047c6fac4a
BLAKE2b-256 acf1eb01f178196f7a76bba9e87d1cd8c2b371a2c00aafef2f58a01eac5e09b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e8c840c483e90442db9b4f23a78d9d7e70d9fe133ffa50682ee2f631c56e44ac
MD5 cbe627d062442063c2076e12bd5f44f9
BLAKE2b-256 19b5a4cb89dfbbc2d6c7e298195b5a579ddd60c599c220168de5ee171c71f999

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 100.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.6.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b8b9a18d942dc1b5b81aa2517313793aba953f26b531734b42f9fee68265336a
MD5 e379b3e91242ef75456258558fb0e742
BLAKE2b-256 395b5eb2fa92614ab84d812ae837f5051085099d10eabc8e3ee855d5090650cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.2-cp310-cp310-win32.whl
  • Upload date:
  • Size: 98.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.6.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 df94f2250d1836aac9f3f2fe2687a2cb2cb0acd78c360953712ee624a181d4d7
MD5 347b301321c5cfa797d26a1a60ae841c
BLAKE2b-256 39c718efbcf9884e5c0c0b8942b9f0a58428c06aaba1c164f708a5f778c855ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c788588c2c00df70f9aa24b1b50519abac549621cb8e4eb0357eb1f88d6d3ee3
MD5 06bf1b6cdab70d75467baefbfc6ff745
BLAKE2b-256 2da7aa845d306307e9d5c1f9e186da45bf24e6d3bea40e35b302631734fabae4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b906177070a577413b9f26a19bcf42f9e8b16ac12380fc621dc0415cc9d7fc04
MD5 00a4fbe4e75db9dbe838ab1a17aead10
BLAKE2b-256 93f312a06a94ba976187175da66ea09433d3b75cc432527ad6f931335d44e54b

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