Skip to main content

py-solfege

A Python library for dealing with musical scales and there solfège.

Static Badge GitHub Repo Code style: black

Why?

I needed a library that I could ask for "in this key, what is the solfege name for this note?"

JS has the Teoria library that could do the scale, but I needed this in Python.

I was unable to find a complete implementation in Python. All other projects I found on Pypi.org, github.com, and using Google search did NOT handle non-diatonic notes (and many required numpy as a dependency -> which is a quite heavy handed dependency for such a task...).

Usage:

>>> import solfege

>>> scale = solfege.Scale(solfege.Note("C"))
>>> scale.solfege(solfege.Note("C"))
'Do'
>>> scale.solfege(solfege.Note("D"))
'Re'
>>> scale.solfege(solfege.Note("B"))
'Ti'

# accidentals are handled
>>> scale.solfege(solfege.Note("C#"))
'Di'


>>> a_major_scale = solfege.Scale(solfege.Note("A"))
>>> a_major_scale.solfege(solfege.Note("A"))
'Do'
>>> a_major_scale.solfege(solfege.Note("B"))
'Re'
>>> a_major_scale.solfege(solfege.Note("C#"))
'Mi'

# minor scales are done with movable-Do, La-based method: https://en.wikipedia.org/wiki/Solf%C3%A8ge
>>> a_minor_scale = solfege.Scale(solfege.Note("A"), solfege.ScaleType.MINOR)
>>> a_minor_scale.solfege(solfege.Note("A"))
'La'
>>> a_minor_scale.solfege(solfege.Note("C"))
'Do'

See the docs.

Metadata

Release files for solfege 1.0.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 solfege 1.0.0
File Size Uploaded Provenance Actions
solfege-1.0.0.tar.gz 4.7 kB Without provenance Details for solfege-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.1 kB

Release files / solfege-1.0.0.tar.gz

Download URL solfege-1.0.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5f9e2b997c1e20b768707a9646ffb5593d04fb0fd26cab5136a5cc6260a8e0e3
BLAKE2b-256 checksum
How to use checksums
b0fac74c7545bdc3540fc45dc4913fb5738ef194a390b20dc0769292cadf4cc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / solfege-1.0.0-py3-none-any.whl

Download URL solfege-1.0.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
269cafc5ed5b09ac71d46c51f01c475fa190eab053c8cfc4263eafdb2c342c7a
BLAKE2b-256 checksum
How to use checksums
160ddf6cd691fb9d547609850c4670f4ea9155fdf74db984ca3aee66851bf7a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Security for solfege 1.0.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.

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