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.2.tar.gz (4.9 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.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: theory_snake-0.2.2.tar.gz
  • Upload date:
  • Size: 4.9 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.2.tar.gz
Algorithm Hash digest
SHA256 207f909a9f0ea85e1630887f4502c212ccc8bb7bf058645ca496e62803e8018e
MD5 4e59f9f15f320793c94506cc4921389c
BLAKE2b-256 ba86bca352b2982038579dba8222c3f21cf719a25720b0fb6ffad2073ebd3070

See more details on using hashes here.

File details

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

File metadata

  • Download URL: theory_snake-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cac92ab6d0f120e01eea96895293c29f404130d931d5656cca4b5695d8523a61
MD5 8af07c732579a6a5c7f1d9e93c6f4934
BLAKE2b-256 84e9b4b747ec27b75b571c9c286623ae30783dc7666e060bdf56a703f73f0c61

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