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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tonalis-0.1.2.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tonalis-0.1.2-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file tonalis-0.1.2.tar.gz.

File metadata

  • Download URL: tonalis-0.1.2.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tonalis-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d02693b0ce854af11f5e3213adbf4991db41c570a4dd80062ecae4567d517959
MD5 b24e025f01aeb18d8975c47fe669a944
BLAKE2b-256 63a0874fa751db6af14d46b932ac9b03c3a30dbe0982133337351b9c65002261

See more details on using hashes here.

Provenance

The following attestation bundles were made for tonalis-0.1.2.tar.gz:

Publisher: release.yml on drycode/tonalis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tonalis-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tonalis-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tonalis-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3715fc35f4ce04d4b8b00a30d29d82118966acd3cfe48c7cf24f7fb48b2cc5b1
MD5 e56cd16cb85c65df4644c8b2ac6a8c9e
BLAKE2b-256 8fa70efe7446e877006810a1de6482202e663044ba15e3753179116347d5d61e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tonalis-0.1.2-py3-none-any.whl:

Publisher: release.yml on drycode/tonalis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

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