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.1.tar.gz (96.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.6.1-cp313-cp313-win_amd64.whl (100.7 kB view details)

Uploaded CPython 3.13Windows x86-64

jmd_format-0.6.1-cp313-cp313-win32.whl (98.2 kB view details)

Uploaded CPython 3.13Windows x86

jmd_format-0.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (180.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

jmd_format-0.6.1-cp313-cp313-macosx_11_0_arm64.whl (97.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jmd_format-0.6.1-cp312-cp312-win_amd64.whl (100.7 kB view details)

Uploaded CPython 3.12Windows x86-64

jmd_format-0.6.1-cp312-cp312-win32.whl (98.3 kB view details)

Uploaded CPython 3.12Windows x86

jmd_format-0.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (180.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

jmd_format-0.6.1-cp312-cp312-macosx_11_0_arm64.whl (97.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jmd_format-0.6.1-cp311-cp311-win_amd64.whl (100.5 kB view details)

Uploaded CPython 3.11Windows x86-64

jmd_format-0.6.1-cp311-cp311-win32.whl (97.8 kB view details)

Uploaded CPython 3.11Windows x86

jmd_format-0.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (177.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

jmd_format-0.6.1-cp311-cp311-macosx_11_0_arm64.whl (97.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jmd_format-0.6.1-cp310-cp310-win_amd64.whl (100.6 kB view details)

Uploaded CPython 3.10Windows x86-64

jmd_format-0.6.1-cp310-cp310-win32.whl (97.9 kB view details)

Uploaded CPython 3.10Windows x86

jmd_format-0.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (178.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

jmd_format-0.6.1-cp310-cp310-macosx_11_0_arm64.whl (97.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jmd_format-0.6.1.tar.gz
  • Upload date:
  • Size: 96.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.6.1.tar.gz
Algorithm Hash digest
SHA256 23c89f7e748eb2031a8d12ba6152a13d3d81c0022333287fda6c311117fba70e
MD5 728a0d813e4d36d00eaf90ea1ff7848c
BLAKE2b-256 33cbc60e06d79b24efb69fb4206fa2b8f12a33c58adca3b8ac674ab8675b50d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 100.7 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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9cd8defc8bf4d6653bc1957310be8469d3b8883db486cde5dbda41199b2d1961
MD5 ed5d5bcff44ab41182c24f534344dd20
BLAKE2b-256 f3143c206060f0d77ff1910cf19a0b11895f6a6974e38e84ac0c5f7faa4941e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp313-cp313-win32.whl
  • Upload date:
  • Size: 98.2 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.1-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 717fd8922715c80ef6cdbdd8a27a6ebb3f087feabd13071111b8a624fa22a5c8
MD5 574e53e1114c37ba10d638105935334e
BLAKE2b-256 9b6065e3408939f5e4274428fa8bdd034a3963fc8a0d8d976851101cf5f606b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec6a3f05ddbda2c5c4a6037d7cc86e1288f470da41e79e9e9c6cb0e8dc123ee7
MD5 e2537fbb66f19d2b06d3d71a1139a8fb
BLAKE2b-256 3ad5cb740a958b00aba73598d0666336ff2f748368b0dfc8ee3a3998175faebe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b0e96391616512a161db8e1b69e35001fdbe3373cc0b2ea6c871823b8c605fb
MD5 aa32b81c63c1beb2ec4c10c1f1657931
BLAKE2b-256 84ab84a59f9f79952c26f6d41627c8c4d4206939bb84bcc333d034ff125b1ffb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 100.7 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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 33fc286f3cae5ec7e32310c26bd64725ed59f7d00a625b408d989cc85dcbbc33
MD5 9f74963f2be3fa136ca15e219be1d4cb
BLAKE2b-256 b7533f7ae6576f94787fd0ca417547f2eee7918a45fb5f6d06d287df30c8931b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp312-cp312-win32.whl
  • Upload date:
  • Size: 98.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.6.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 78c1ce8887023ed3f3cf30b69539266a632d65f34194be494ad6ef6801d233ff
MD5 b791a66c094c4e3416245959ddd6904f
BLAKE2b-256 fd941de020ba49e2aa1f5fe1daa283d19b48565dd04c302ecd60a3d5ec0f200d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2500591ef3697d0cd0fba0cc4007434fb031f0646ee5c79a77a2b0f8973830ea
MD5 e337596ad81538008c56b02fe0d67acc
BLAKE2b-256 4d4ded3f79e89bb8c099008454e329490a2e7f933f189d5fcd16daf55662881a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b331c2f7ba9ae4b485d3e957ccbe091eb20905ca01eef4dbaf4ebb23095e4427
MD5 1e1f915139148e6be8af2fcfa47564de
BLAKE2b-256 6704f7de631c604e60358cef90572ffdb328a188560beb3ace38fedbaa88f892

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 100.5 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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 988d324c5e3ebf5d345eed5b8ce0ad31fd65fd6a8d08562524cc32df312f5e95
MD5 7530c23ddbbf7c8d6895ebf4aa77b560
BLAKE2b-256 7af11e962ae681a1f777a24f748f6e5e5fa651a98f100a1c0397ef08cb1cde58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp311-cp311-win32.whl
  • Upload date:
  • Size: 97.8 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.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 2c047b48c2311a58d47cdbf421d6cafdcc596e8f2fc36f18a57829eabf27eeed
MD5 3235f5cfffc8f97d6b7132283f842a1b
BLAKE2b-256 677355acc285b4f3b41638d69fae42e216c13c65ac05306afa63aee3418917b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 efc2bdcee32032a316cb71a8b405f893276ad075ee86c6613094c89ea4855a85
MD5 81db2c330169146e4caab350a6a55b5a
BLAKE2b-256 82c2bbc8e50d0b7432b058bd4280aa437978d7bfb61655c7b0c86b6dc8ad67c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c5160a478f5c3b3b24ea573a4935de57859b2944fa0e1c56c5db8677d3bf0ea
MD5 80d32289a7f46720cc136979740bbdff
BLAKE2b-256 aef893367e14c0935836f90700f42882e1dfa70cf6322a293b826d0d28e8718c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 100.6 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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3a844f4a65ce71023cd740cec648ebfd4c81e431e468c7040d03ff2846e3fcd2
MD5 442d30fd2e23eeb2681fd475f8e80e54
BLAKE2b-256 dc75e49ef68612d6823a67b3a73eb106d32ecae619040eea7a7d10730150d6d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jmd_format-0.6.1-cp310-cp310-win32.whl
  • Upload date:
  • Size: 97.9 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.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 46bb9f223527d2b24bebfdedcafdb56044146e3265f99c4039befd239d9239b2
MD5 f802b2da6a1c7279a32b35c43760879b
BLAKE2b-256 cea8c91e2301584fb67e4a60259baf015055a2088dd0d5c4e9b17a9686be7850

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc0dac330bb593e3083b3bae4da8f597f23a67ac438d0b95eccdfce1cb46c13f
MD5 42ad5bda17f3bae20839ba4de0ffe885
BLAKE2b-256 cbb96710e756e50616d63efb2bc714386ac838590d909fa47937341accca0a35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jmd_format-0.6.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03c81203a3e1f1505745c2ef0aa717c19fffbce33191bc12ee7e895c3a4cb539
MD5 a439b062e19f1e6a4a454dd374441d4d
BLAKE2b-256 2aba757eaa566901729f3dac49f6d8b2e6c6884dbfe10f3c4d37c9aa9a049e66

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