modgraph
modgraph is a tool to explore a collection of tracker module files as a module->sample graph.
It can function both as a CLI app, and as a library to use in notebooks.
In fact, this file is a notebook!
Using through CLI
!python -m modgraph --help
usage: modgraph [-h] [-f {csv,d2}] [-r RANK] files [files ...]
positional arguments:
files module files to analyze
options:
-h, --help show this help message and exit
-f {csv,d2}, --format {csv,d2}
output format
-r RANK, --rank RANK min number of repeats for sample to be included
Example:
!python -m modgraph *.it --rank 6 --format csv
mod_path,sample_name,sample_hash
catherine on the waves.it,tambourin.steel.quiet ,e1b32f84b2b788f0a58e277f4e152df5
catherine on the waves.it,piano.001 ,8ef52cdf9c20c9ada9df7bf4d3b59fc3
dallying sadly in space.it, ,e1b32f84b2b788f0a58e277f4e152df5
drifting to plutonia.it,tambourine.steel.quiet ,e1b32f84b2b788f0a58e277f4e152df5
heavenly fantasy.it,tambourin.steel.quiet ,e1b32f84b2b788f0a58e277f4e152df5
neverending illusion.it,piano.001 ,8ef52cdf9c20c9ada9df7bf4d3b59fc3
"so close to you, my angel.it",piano.001 ,8ef52cdf9c20c9ada9df7bf4d3b59fc3
sorrow.it, ,8ef52cdf9c20c9ada9df7bf4d3b59fc3
sylvia.it,piano.001 ,8ef52cdf9c20c9ada9df7bf4d3b59fc3
tender storm.it,tambourin.steel.quiet ,e1b32f84b2b788f0a58e277f4e152df5
why (enhanced version).it,piano.001 ,8ef52cdf9c20c9ada9df7bf4d3b59fc3
why (enhanced version).it,tambourin.steel.quiet ,e1b32f84b2b788f0a58e277f4e152df5
Using as a library
import pandas as pd
from modgraph import modgraph
from glob import glob
# digest your library into a mod_path -> sample_hash mapping
df = pd.DataFrame(modgraph(glob("*.it")))
df = df.set_index(['mod_path', 'sample_hash']).sort_index()
df
| sample_name | ||
|---|---|---|
| mod_path | sample_hash | |
| a day at the river.it | 13dc761472f1e73cff4ed428be35a5c2 | SoundWave.HiQual |
| 29797bec77f15b782ee0d8f855720213 | rimshot | |
| 3e741972e4147bfc395467a293bb11a4 | Flute (Skaven) | |
| 46a82c17348315db0ec7d4558fb4a9e9 | fx.750 | |
| 6ce9cd4d2bd435dc6b410b4bc65eab2d | river.wav (Eagle) | |
| ... | ... | ... |
| why (enhanced version).it | d9d2074594be1e44cebafdc840c84b94 | DX-Strings 1 |
| dcacd358eb1c8a23027d1dad35e44726 | osterm1bass1 | |
| e1b32f84b2b788f0a58e277f4e152df5 | tambourin.steel.quiet | |
| e4f1c0e5019b51ff947d0966eeac29f8 | electric.guitar.solo1 | |
| f8d42ab1418cdbf77a53355b600fc7fe | bassdrum.459 |
216 rows × 1 columns
def most_used(df, cutoff):
df = df.groupby("sample_hash")
df = df.agg({"sample_name": [("name", lambda g: g.mode()[0]), "count"]})
df = df.sort_values(("sample_name", "count"), ascending=False)
df = df[df[("sample_name", "count")] >= cutoff]
return df
most_used(df, cutoff=3).plot(kind="barh", x=('sample_name', 'name'))
<AxesSubplot: ylabel='(sample_name, name)'>
Metadata
Release files for modgraph 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| modgraph-0.2.2.tar.gz | 5.3 kB | Without provenance | Details for modgraph-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| modgraph-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for modgraph-0.2.2-py3-none-any.whl |
Total release size: 10.8 kB
Release files / modgraph-0.2.2.tar.gz
| Download URL | modgraph-0.2.2.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0761997b7c4af3e54b481c0191f9155e61507965f51b0618c4e2a2ee52a830be
|
|
BLAKE2b-256 checksum How to use checksums |
daec170a880a060f65734cf549728baf3cb476a8c9035c2105ce53aeca8a5c25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.3.3 CPython/3.10.8
|
Release files / modgraph-0.2.2-py3-none-any.whl
| Download URL | modgraph-0.2.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa2561cd0efa25d4d3c515a89e1422aaf6d8394998350ece7fb14f63a458a186
|
|
BLAKE2b-256 checksum How to use checksums |
2611ac816785593a8497d0cdacfad9c5d8b7e7cac6b3f8e2deea21181a53d574
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.3.3 CPython/3.10.8
|
Security for modgraph 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.