Skip to main content

MTXT - Music Text Format - Python Bindings

This is a Python binding to the MTXT library. See their readme for more information on the project and format details.

What is MTXT?

MTXT is a human-editable, text-based format for representing musical performance data. It stores events with precise timing, pitch, and expression values in a simple line-based structure that's easy to edit without requiring specialized tools.

The format is designed for cases where exact performance details matter - arbitrary timings, micro-tuning, dynamic changes, and other expressive parameters. MTXT avoids binary encoding, making it suitable for manual and AI-assisted editing.

Usage

import mtxt

# Parse MTXT
file = mtxt.parse("""mtxt 1.0
0 tempo 120
0 note C4 dur=1 vel=0.8
""")
# Or using file I/O
file = mtxt.load("song.mtxt")
file.save("output.mtxt")


# Access properties
print(file.version)           # "1.0"
print(file.duration)          # 0.0 (beats)
print(file.get_meta("title")) # metadata


# MIDI conversion
file.to_midi("output.mid")
file_from_midi = mtxt.MtxtFile.from_midi("output.mid")

# Print as mtxt string
print(file_from_midi)
# Prints: MtxtFile(version=Some("1.0"), records=3, duration=Some(0.0))
print(repr(file_from_midi))

How to build the library

pip install maturin
maturin develop --features python,midi

# run tests
pytest tests/python/

For more details on the MTXT format specification and CLI options, see the main MTXT repository.

License

Original MTXT library: Copyright © 2025 Dani Biró Python bindings: Copyright © 2026 Sven Hollowell

MTXT specification and reference implementation are dual-licensed under the Apache-2.0 license or the MIT license, at your option.

Metadata

Release files for mtxt 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mtxt 0.9.0
File Size Uploaded Provenance Actions
mtxt-0.9.0.tar.gz 65.9 kB Without provenance Details for mtxt-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mtxt 0.9.0
File Interpreter ABI Platform Actions
mtxt-0.9.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for mtxt-0.9.0-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 445.6 kB

Release files / mtxt-0.9.0.tar.gz

Download URL mtxt-0.9.0.tar.gz
Size 65.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f4cef689d749bb6bef639df521502428cffe9072e6a59009838d4ad14cb34723
BLAKE2b-256 checksum
How to use checksums
2302c5e3728bb298b75e560074f534158c5c08e2a81073c119201a01b98f1ff0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.11.5

Release files / mtxt-0.9.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL mtxt-0.9.0-cp310-cp310-macosx_11_0_arm64.whl
Size 379.6 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e5f671540045d65d69d27712217102dbf25330e04bd68e1302a9faa3cab9336d
BLAKE2b-256 checksum
How to use checksums
5b8b6f9c33336aae0d2fc6d12f91f0e9c6b57491b3a790549ffed765dff37f44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.11.5

Security for mtxt 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page