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.2.4.tar.gz (5.4 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.2.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: theory_snake-0.2.4.tar.gz
  • Upload date:
  • Size: 5.4 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.2.4.tar.gz
Algorithm Hash digest
SHA256 78484c8bd4a12dc3703188ffecb482f7a54ec5b3e3e78722dea8ca0da4869e6a
MD5 e699c33aa7355b80795e6f7c21b39f47
BLAKE2b-256 34b7643b950cf65534827be08afe9908886b8d1e9979606f04bed805bd81a081

See more details on using hashes here.

File details

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

File metadata

  • Download URL: theory_snake-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d553aa698b651a29a22d176bb2451b20da7ae5f83514b0a01b9f803be4052b10
MD5 8cd06352e9bc9fdba98c40c637ab4cb3
BLAKE2b-256 374878ffa575f121a4a06390be230281780288a3fe61c84a393d5cdf4f777490

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