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

Uploaded CPython 3.13Windows x86-64

jmd_format-0.4.2-cp313-cp313-win32.whl (74.1 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.4.2-cp313-cp313-macosx_11_0_arm64.whl (70.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.4.2-cp312-cp312-win_amd64.whl (76.9 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.4.2-cp312-cp312-win32.whl (74.2 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (143.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.4.2-cp312-cp312-macosx_11_0_arm64.whl (71.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.4.2-cp311-cp311-win_amd64.whl (76.8 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.4.2-cp311-cp311-win32.whl (74.0 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.4.2-cp311-cp311-macosx_11_0_arm64.whl (70.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.4.2-cp310-cp310-win_amd64.whl (76.8 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.4.2-cp310-cp310-win32.whl (74.1 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.4.2-cp310-cp310-macosx_11_0_arm64.whl (71.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.4.2.tar.gz
  • Upload date:
  • Size: 60.6 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.2.tar.gz
Algorithm Hash digest
SHA256 a40d76da270ee047a841bba2d59256d930e890822891112324a6a3f2e2c49d51
MD5 c7714d0189be1c02770b97c6fe6b213f
BLAKE2b-256 7f3ca499aca6a4a96bf9ecf3925a01bbf8cbbe5bce4a408447e78316db1a0732

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 76.9 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fcf2b29afa42a4a84fce9759a67b6688ff468c4e749702932861d1477556f9d8
MD5 528d4bfbe5026e7279a27119568720d4
BLAKE2b-256 f01ae22e5345c62e221d6f03f54b7f9baab63a66841eb4dea41da51cee60ccbf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp313-cp313-win32.whl
  • Upload date:
  • Size: 74.1 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.2-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 c95857b40869df386c36e6ed84567160a14e6e5b1d0ba9fca6f3fdf95e4fd69a
MD5 ccc7da0652d3e55873e9079e924628b9
BLAKE2b-256 7f1b896bd33d10a6958f792dfd80c2c4206325f1d91c71aad83db1a2fd65186f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 417deb884c162dbbac65ded8e09510520805077f2c70df94b5e4a325d54bac6d
MD5 5c1bfcc127be953b83e0eb0e674d01b9
BLAKE2b-256 1219f46e5ce73937febded60b00a85c26d47c768965ae0336607fab407d4da98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 efff20ae9e5da48973cd0fa0d6220f3607c7a49b7abc532693d2842c5cb25ffb
MD5 220d51c4dbedfa6ee613893315ddf058
BLAKE2b-256 7075b4b288e09a6cdc57cdaf6596f4c2609924faad229e998324c5c8a958de9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 76.9 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f458fdb5be1a52967340781dfef1c98c93902edfb4e1bd3cd1732e858b2544e4
MD5 88dd9b7822ac3220a5ec47163fcb42b6
BLAKE2b-256 5ee86ff17db150f2f40f320c3ed4a3bdad11df574dfadb9788ffd24429f14cfe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp312-cp312-win32.whl
  • Upload date:
  • Size: 74.2 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.2-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 7571c9f2dccb4f63697c0135b12ccf963d0f8888c8332312f45081796f8dde5a
MD5 38fc9c2b362ff19dbcdfa10466e6fda0
BLAKE2b-256 30c6bdcd2e0ae199a6933af6371d19af074e4c7a5913c910213767a7472fc946

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 656c269119dc9599724ef8e154fb8e356fa035fa082f300740f9f540e546b5bd
MD5 5d7922f2fe0c0ecbe9565acdec579dd6
BLAKE2b-256 eefbf8f2af11a0208c76e6e19fa0518ce1271d097178e10fef26b9ebd167770f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d490354cf66c8a5860dcdb18310af9c9d399adfa46830fd34bed85b887e564f9
MD5 4e0b6f49062b4e24a0662b4d3889c47a
BLAKE2b-256 f6c1283d66266336faa8e9a49dbe7be32b14227ad85ac43fe7e8fb897dc5575a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 76.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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e6d7734f3a063921fb7e61b3f1a9995d8ecdb0a02a9e10747259f60f8256f1cd
MD5 04a30b8dd63993bdfc955a8a1025749e
BLAKE2b-256 3c8ad041da16d232edf1c388e9a482207abefac3f3ded176bfe478ac7a211a0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp311-cp311-win32.whl
  • Upload date:
  • Size: 74.0 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.2-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 ed9186fb9bf42fe409255d9233430d2c36343eda39915270737f2645a2769e00
MD5 a1d69e50ae8cfc41792d9b698acf5fa1
BLAKE2b-256 d37cbea69849b738b7415f375fd6a4fbee67c5d8d1454333053b8567a157a6b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cee5a052e90118567bf633f3f7973e7987b4c3b71afde6df5ece5405d7fd4a38
MD5 aabfe8c2366ebd8025905a1093644ccb
BLAKE2b-256 0e12a76b427a5580446b6341802d1a32312100df891bc70093be03857de221ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f80bfc63e1b4f6f9689ec4cdb5bb12988750269d6a3b97639f83f6c3a6aade7
MD5 b86303a23564b51e3d849cd2c5075c3d
BLAKE2b-256 2532634f04a6e39e003cdb62a3deb03721c85008386c970898da047e1bf34aa4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 76.8 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 33cf5bd276c9f6286dc7e60fc99db5e450e867f798f120bb7520c8219a8435b5
MD5 7c7feae3faa2d0c890659bd7e9fd8a87
BLAKE2b-256 7733f7169f3d4d03452d6a16269f13219abdee3990ca51fe9248834e2a36ca39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.4.2-cp310-cp310-win32.whl
  • Upload date:
  • Size: 74.1 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.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 b2791a7c97c868afbf17d2f476c89e04cf8bcb4432efadcf4122e524ebe3e438
MD5 357dead1af99bcfcc7134ee8e2d2f6b8
BLAKE2b-256 2c7e02a1ab9a96035dd85f3acdb9074aad9fe37b958bd5d6c8d28216041eb052

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ad24e097f5d056be168415323e381530cf538c9d9092397a80c503765c91a82
MD5 773e75ffc7c3cf82952c54af22b07e08
BLAKE2b-256 213d885732daa30d4a9cdbef3a6c8da25447b8b6495802cc9a1fd1df1efb7172

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d1e203fe89a064686a2e2c1e580497a492d04cb463a8160e61c15e7b0bd11aaf
MD5 46a5d1ad4d0cfd3d01295d15c54602bf
BLAKE2b-256 553a8447ffafcef4614f9a8aa92790f62b90aedcb2321d2022fd0b9ec53b6aad

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