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.3.tar.gz (5.2 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.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: theory_snake-0.2.3.tar.gz
  • Upload date:
  • Size: 5.2 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.3.tar.gz
Algorithm Hash digest
SHA256 5666807829bcd5dd40b955c0796354061d04f92952d139c088586eaa4bab80d1
MD5 e43d26eb6c6a47b3d891aa83231ae75c
BLAKE2b-256 c9b6169a875f4a6ee4491fa84e063d480b38a49bf2e6ab1f08674d589c9fabbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: theory_snake-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b014acec2540e6da39c1253972ac10d1c02400673569e1071b6cfb6e644b9577
MD5 73bd24ff361036773af78418acd3901f
BLAKE2b-256 7e6ed5fa832dce7b01fb86b9fff016d086b22b67ede6b6965b011aa9d298d535

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