Skip to main content

A simple Python library for generating music chords and scales.

Project description

theory_snake 🐍🎶

A compact, modular Python library for music theory and guitar modeling. It provides utilities for notes, scales, chords, tunings, fretboards, and mapping theoretical chords to playable guitar shapes.

Python License

Table of Contents

Features

  • Note utilities (sharps, flats)
  • Scale generation (major, minor)
  • Chord modeling and builders
  • Guitar utilities: tunings, strings, fretboard builder
  • Map theoretical chords to playable guitar shapes

Install

Install from PyPI:

pip install theory-snake

Or install from source (editable):

pip install -e .

Quick Start

Import core utilities:

from theory_snake import note_utils, scale_builder, chord_utils

# Constants / metadata
from theory_snake import consts
print(consts.__info__)

Note utilities:

import theory_snake.note_utils as nu
print(nu.get_sharp("C"))  # C#
print(nu.get_flat("E"))   # D#

Scale builder:

import theory_snake.scale_builder as sb
print(sb.build_scale("C", "major"))
print(sb.build_scale("A", "minor"))

Chord model & utilities:

from theory_snake.models.chord_model import Chord
from theory_snake import chord_utils as cb

chord = Chord("C", "major", ["C", "E", "G"])
print(chord.__info__())

c_major = cb.build_chord("C", "major")
print(c_major.notes)  # ['C', 'E', 'G']

Guitar utilities (tunings, strings, fretboard):

from theory_snake import guitar_utils as gu

tuning = gu.tuning_utils.select_tuning("Standard")
fretboard = gu.fretboard_builder.build_fretboard(tuning)
guitar_string = gu.string_builder.build_guitar_string("E")

c_major = cb.build_chord("C", "major")
guitar_chord = gu.guitar_chord_utils.make_guitar_chord(fretboard, c_major)
print(guitar_chord.__info__())

Project Structure

theory_snake/
├── consts.py
├── note_utils.py
├── scale_builder.py
├── chord_utils.py
├── guitar_utils/
│   ├── tuning_utils.py
   │   ├── string_builder.py
   │   ├── fretboard_builder.py
   │   └── guitar_chord_utils.py
└── models/
    └── chord_model.py

License

This project is licensed under the MIT License. See LICENSE for details.


Project details


Download files

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

Source Distribution

theory_snake-0.3.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

theory_snake-0.3.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file theory_snake-0.3.0.tar.gz.

File metadata

  • Download URL: theory_snake-0.3.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.2

File hashes

Hashes for theory_snake-0.3.0.tar.gz
Algorithm Hash digest
SHA256 53b76a247cb9165204c8d2a4e801ef14f3c02c3b7dc0e2321e8ccd7929a6287d
MD5 dd0238fe5e50674d745dbc1b61947127
BLAKE2b-256 c2b1530ab75ca2efb817175c0039a9c774b146eebdb4dd8ff47c96477f0f4c04

See more details on using hashes here.

File details

Details for the file theory_snake-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: theory_snake-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.2

File hashes

Hashes for theory_snake-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fef9b39dd7c0d6f8e74ea15c79c9dadf247908b8eb808b38e9a24541c30d17e9
MD5 dccb19379dbbfab087eae317131edc19
BLAKE2b-256 f4d9c859a3aaae4b05e6982653f9a5115ab3362e43724ff242fe52c8476cd993

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page