Skip to main content

tonalis

A generic, format-agnostic music-harmony DSL for lead sheets: parse chord charts to a canonical AST, lint them with structured findings, and render back to canonical text or JSON. This is the Python reference implementation; TypeScript (tonalis on npm) and Rust (tonalis on crates.io) ports conform to the same normative spec and a shared 255-case conformance suite.

Music-theory questions (chord validity, scales, keys) are delegated to the pure tonalis-music-dsl theory library.

Install

pip install tonalis

Use

from tonalis import parse_dsl, lint, serialize, to_json

result = parse_dsl(open("chart.txt").read())
findings = list(result.findings) + (lint(result.chart) if result.chart else [])
chart = result.chart            # a LeadSheet AST
json_obj = to_json(chart)       # canonical JSON (a dict)
text = serialize(chart)         # canonical text rendering

A small CLI is included: python -m tonalis chart.txt prints lint findings (exit 1 if any error).

Links

Metadata

Release files for tonalis 0.1.2

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

Source distribution (sdist)

Source distribution for tonalis 0.1.2
File Size Uploaded Provenance
tonalis-0.1.2.tar.gz 16.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tonalis 0.1.2
File Interpreter ABI Platform
tonalis-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 kB

Release files / tonalis-0.1.2.tar.gz

Download URL tonalis-0.1.2.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d02693b0ce854af11f5e3213adbf4991db41c570a4dd80062ecae4567d517959
BLAKE2b-256 checksum
How to use checksums
63a0874fa751db6af14d46b932ac9b03c3a30dbe0982133337351b9c65002261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / tonalis-0.1.2-py3-none-any.whl

Download URL tonalis-0.1.2-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3715fc35f4ce04d4b8b00a30d29d82118966acd3cfe48c7cf24f7fb48b2cc5b1
BLAKE2b-256 checksum
How to use checksums
8fa70efe7446e877006810a1de6482202e663044ba15e3753179116347d5d61e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Security for tonalis 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tonalis-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

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.

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