A library of microtonal scales with sources attributed
Project description
scale-library
Python package bundling the data from scale-library, a library of microtonal scales with sources attributed.
scale_dir()returns the path to the directory containing the bundled scl filesscale_index_path()returns the path to the scale index csvparse_scl_info(text)parses thescale-libraryscl file[info]blocks containing structured metadata
Install scale-library:
$ pip install scale-library
Read an individual scl file:
>>> import scale_library as sl
>>>
>>> scl_path = sl.scale_dir() / "damusc/Georgia_GVM206-M.scl"
>>> scl_text = scl_path.read_text()
Read the scale index as a dataframe:
>>> import pandas as pd
>>> import scale_library as sl
>>>
>>> scale_index_df = pd.read_csv(sl.scale_index_path())
The scl files in scale-library contain [info] blocks for structured metadata, for example:
! xenoga24.scl
!
Xeno-Gothic rational adaptive tuning, 3-7 ratios (keyboards 64:63 apart)
24
!
64/63
2187/2048
243/224
9/8
8/7
32/27
2048/1701
81/64
9/7
4/3
256/189
729/512
81/56
3/2
32/21
6561/4096
729/448
27/16
12/7
16/9
1024/567
243/128
27/14
2/1
!
! https://yahootuninggroupsultimatebackup.github.io/tuning/topicId_16640.html#16640
!
! [info]
! source = Mailing lists
! file = tuning/messages/yahoo_tuning_messages_api_raw_0-19436.json
! topic_id = 16640
! msg_id = 16640
Parse a scale-library scl file [info] block:
>>> import scale_library as sl
>>> from pprint import pprint
>>>
>>> scl_text = (sl.scale_dir() / "mailing-lists/xenoga24.scl").read_text()
>>> info = sl.parse_scl_info(scl_text)
>>>
>>> pprint(info)
{'file': 'tuning/messages/yahoo_tuning_messages_api_raw_0-19436.json',
'msg_id': '16640',
'source': 'Mailing lists',
'topic_id': '16640'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scale_library-1.1.0-py3-none-any.whl.
File metadata
- Download URL: scale_library-1.1.0-py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d18b2b97d671eff82208902770c4588203474724c6ae8e71a1f21dfb36f0b9ce
|
|
| MD5 |
803b3bb34f64121bd17da500537ad393
|
|
| BLAKE2b-256 |
74ed6b0cd5124492e520280c8d3fc1accef6c75fee5491c14c77262f7aa70f41
|