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 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.5.1.tar.gz (86.9 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.5.1-cp313-cp313-win_amd64.whl (96.2 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.5.1-cp313-cp313-win32.whl (93.7 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (177.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.5.1-cp313-cp313-macosx_11_0_arm64.whl (93.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.5.1-cp312-cp312-win_amd64.whl (96.2 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.5.1-cp312-cp312-win32.whl (93.7 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (177.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.5.1-cp312-cp312-macosx_11_0_arm64.whl (93.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.5.1-cp311-cp311-win_amd64.whl (96.0 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.5.1-cp311-cp311-win32.whl (93.5 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (174.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.5.1-cp311-cp311-macosx_11_0_arm64.whl (92.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.5.1-cp310-cp310-win_amd64.whl (96.1 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.5.1-cp310-cp310-win32.whl (93.6 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (174.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.5.1-cp310-cp310-macosx_11_0_arm64.whl (93.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.5.1.tar.gz
  • Upload date:
  • Size: 86.9 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.5.1.tar.gz
Algorithm Hash digest
SHA256 6aef80c319435c6721302b63c17de2ed4a129d1518bf087807dda61bf2ad528c
MD5 f35bfbc9be84d8a2c9c34b4140616ded
BLAKE2b-256 86e891e0ee13b758801e53c7d17e3f5a088add2198c1290fa731e0a5713960f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 96.2 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.5.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 71a0dc6c5e1ec7bb113cc0dfea6e797addc1eb1daeeae280321bed72761f1ff4
MD5 379917ff914a86c4eff29ac306087445
BLAKE2b-256 e7e0fbb21288da271b751a847e885ffa7e7cd7e659b3be6e94dd7ff88048c724

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp313-cp313-win32.whl
  • Upload date:
  • Size: 93.7 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.5.1-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 ad6ef1dded6515696050b58dee2f13ef37103694363da2dcb3590d4aa3433c16
MD5 1a4af192eb12e074489f45da0fd09a51
BLAKE2b-256 61ae0a2c03d5e7aac2fcccd98fa2f81454a91bfda7809f669fb293baaabae703

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb603e8903778b7458d6e2fcef71fa7258979c21130a9ea9adf0d5621fc5bf5f
MD5 7aa8378834264978e3f52b7e9c21b8bf
BLAKE2b-256 59ef6ebb73273783d6085921ef487c3cd70fa10e1258d0cac9fe8ba98b826a4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6bf512c5d7f15c1dcaf7451d0ee875ea60306d93eba03e809b6be84099e7e43f
MD5 057e09d35b6768eba96ac47240138344
BLAKE2b-256 15ebe97e0575cccc00884673f38739f564a0c9f3d6b8f30310d7514735b741c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 96.2 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.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2689a853b1e9899334955e803e3a348c7feff7ee81c642445ad3356f6c069261
MD5 39281a11da1afbec481a6912e19637b1
BLAKE2b-256 65b93dff0e869a41958b2ac602a429d4ad472de4201440140cd2d77fb0b6497d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp312-cp312-win32.whl
  • Upload date:
  • Size: 93.7 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.5.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 314be333348afd812e4c9289093a9c8ab1ee0e397139f1c04952958f147201ed
MD5 10cdf83132f25cf7642caf454003db17
BLAKE2b-256 9503efbef7e59b7a65598037fa311b8c6be766ca0d201b64b0b4d5eb0c38b331

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9eb97c0632cc3cdab7d41521bed21980300208914f39ea3b461333bfebdf5313
MD5 8a6dcad7e9be85962f20c664d3f3f601
BLAKE2b-256 fb4929abced8558c18a3506c3291e3de50f6ef5df3e41244d44a7214d3920d62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b10be8803df038315ef96fd0e15608477da3c21a588dc16d3da71f4e092c7999
MD5 a4b14cd31fcc4f3b07eaf5e509e03895
BLAKE2b-256 d2d67716a7c5bebfa1e7be55ba0111f9b83d39be404f0a898da9e697230238da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 96.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.5.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 de13c8a5aa989b9b3a03d2c923373924291b69ae3ed2263688e87ae9771e7234
MD5 541f059fa22d5175e1431415a709c965
BLAKE2b-256 2eb089342f2d5a7e2551eb6b67319b38ee9cc71724689a080972fb0d41b61dfc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp311-cp311-win32.whl
  • Upload date:
  • Size: 93.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.5.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 08e9a0c8f8c5a5481dc3a6a98b548853cfee5affe394b3d4487c4bc58a3be2b7
MD5 5469309d759a420e4e5c70b92c50dcfb
BLAKE2b-256 7fee045bad108235f495067fda0478dd508ce5f71021ae6a896d878db4bdb5c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98e7c6280f9029ec1c7c339c635f848c4a872218644f61d799d349ecd68de2f2
MD5 38c0ae620890955a5c87286f6ae04b3c
BLAKE2b-256 009295619af239273ef98ef6e26ed5ca54252b8bbabef8232207860b582d044c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c6fde740e8695c395f8a999bf3bd2bf788034e547d1bad240c13727e1a68dee
MD5 0c0dcf2fb81786cf287662b4ad5acce3
BLAKE2b-256 f3dd437378d4731076ab13c6d6d113eac7eebb6cd2820f9644bcc074b7ee2eae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 96.1 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.5.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9bd7b02d88eafb796afcabdfa760ca98429b15bd23ff7888cdcd99af4ae81a5b
MD5 7cc46a5ad03393841d11e19c8799eeab
BLAKE2b-256 ec95c3f6bec68348dec8ea5bab3461b179aa3f7fce8763dd5a49b40f31987a9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.5.1-cp310-cp310-win32.whl
  • Upload date:
  • Size: 93.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.5.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 6d020533b4b75e83fc73e6fea27861ddf4d45e23c737fb2662d4f2b75afbec7c
MD5 8483d8d42882c1977f8bc1fb32301398
BLAKE2b-256 26bc09696155f91211375a2f6d81cf837153646ca0e5d2f8d084b944a3cc5964

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d30e4dc4d9717c1a3adba073a5cb51db3c8ff4f443104014213c7b1bd97ff73d
MD5 4d92f32682e8531dd21c7eb3a5f759a5
BLAKE2b-256 66c1f00e97fcb9b99d1818195ae45f07c1747e16366b1c2aba7a02badff70730

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.5.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c88b85359dfc6c239aa669e35565a234b9abf75fe467b793bf022792d3d7901
MD5 c00b7217788f99f9834c00a32b81efbb
BLAKE2b-256 0acc4b789ff26c8af6f581f20dc54e0905e1811fcde06891b9802d2c1c59e935

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