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.1.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.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tonalis-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 bd5a330c4e4a02b27d369c3500f0a940ac408e82a27c2ee30057d25fba6afd90
MD5 90f97f321605c7b7beb88fecdc3f0d0d
BLAKE2b-256 4615754e283dc4a93361be1d556db43dc369aaad082d711ffcd8712411631e32

See more details on using hashes here.

Provenance

The following attestation bundles were made for tonalis-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: tonalis-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7121bb06699ea4fd42c0ef6a4f7a3c6ad3c96aaaf9e220e41791107c5b45085d
MD5 6ad23f7d129d31dc058483acdd7d3f91
BLAKE2b-256 feeb30cb252f359bca855f4e0cfefdf2b696dc8092f0e4b832c264bc7f4c64bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for tonalis-0.1.1-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

0.1.2

2 files

This release

0.1.1 This release

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