Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5badd5e
Initial loading from js data experiments
zmoon Mar 21, 2025
d9c8896
Add some of the tunebook URLs
zmoon Mar 21, 2025
a2e108e
Download/store data
zmoon Mar 21, 2025
c9252cf
Data loader; remove certain lines when downloading
zmoon Mar 21, 2025
f299750
Make share URL from ABC string
zmoon Mar 21, 2025
5d829e0
Test out Eskin share URL gen
zmoon Mar 28, 2025
59e495d
Get all current tunebooks loading
zmoon Apr 9, 2025
83daef0
tweaks
zmoon Apr 9, 2025
dce5faa
Please mypy
zmoon Apr 9, 2025
97cd5d2
Stick with older typing
zmoon Apr 11, 2025
ba5c1db
Add a basic Eskin URL creation test
zmoon Jan 5, 2026
b31f8a4
Please linter
zmoon Jan 5, 2026
085c4d1
Merge remote-tracking branch 'origin/main' into eskin
zmoon Jan 5, 2026
4d5d613
Add short Eskin example
zmoon Jan 5, 2026
ddb36b4
Document tunebook keys; add OFla
zmoon Jan 7, 2026
9d2f3c8
Quiet Pyright a different way
zmoon Jan 7, 2026
30d01e4
Return df from `eskin.load_meta`
zmoon Jan 7, 2026
527a3b6
Test `sources.load_url` dispatch to Eskin
zmoon Jan 7, 2026
b4daa10
Test other netlocs for load_url
zmoon Jan 7, 2026
bbe5a58
cov
zmoon Jan 7, 2026
2549de5
Help pytest-xdist
zmoon Jan 7, 2026
c2f8059
Test different Eskin ABC line filtering settings
zmoon Jan 7, 2026
d9ac5a7
Add explanatory test of Eskin redirection
zmoon Jan 7, 2026
104ffe8
Error message if lzw missing
zmoon Jan 7, 2026
39e430d
Normalize tunebook key for result too
zmoon Jan 7, 2026
0f08969
assert -> log
zmoon Jan 7, 2026
baa9697
Include failed parse info in RuntimeError instead
zmoon Jan 7, 2026
04290a4
Document Eskin redownload option
zmoon Jan 7, 2026
f3f47d2
Add changelog entry
zmoon Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[flake8]
max-line-length = 100
ignore = E203,E402,E501,W503,E226
per-file-ignores =
pyabc2/sources/_lzstring.py: E111,E225,E261,E302,E303,E703
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.vscode
pyabc2/sources/_*
!pyabc2/sources/__init__.py
!pyabc2/sources/_lzstring.py
poetry.lock
venv*/
docs/api/
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ repos:
rev: '7.0.0'
hooks:
- id: isort
exclude: ^pyabc2/sources/_lzstring.py

- repo: https://github.com/psf/black-pre-commit-mirror
rev: '25.12.0'
hooks:
- id: black
exclude: ^examples/
exclude: ^examples/|^pyabc2/sources/_lzstring.py

- repo: https://github.com/PyCQA/flake8
rev: '7.3.0'
Expand Down
17 changes: 17 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,20 @@ Functions:
the_session.load
the_session.load_meta
the_session.load_url

Eskin ABC Tools
---------------

.. automodule:: pyabc2.sources.eskin

Functions:

.. currentmodule:: pyabc2.sources

.. autosummary::
:toctree: api/

eskin.load_meta
eskin.load_url
eskin.abctools_url_to_abc
eskin.abc_to_abctools_url
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Fix loading The Session sets data ({pull}`77`)
* Fix HTML display of pitch classes with double accidentals ({pull}`76`)
* Fix Norbeck URL gen for multi-word tune types (e.g., slip jig, set dance)
* Add initial support for loading Eskin ABC Transcription Tools tunebooks ({pull}`86`)

## v0.1.0 (2025-07-02)

Expand Down
63 changes: 61 additions & 2 deletions docs/examples/sources.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"metadata": {},
"outputs": [],
"source": [
"from pyabc2.sources import load_example, norbeck, the_session"
"from pyabc2.sources import load_example, norbeck, the_session, eskin"
]
},
{
Expand Down Expand Up @@ -360,11 +360,70 @@
" )\n",
");"
]
},
{
"cell_type": "markdown",
"id": "31",
"metadata": {},
"source": [
"## Eskin\n",
"\n",
"Michael Eskin has tunebooks available at <https://michaeleskin.com/tunebooks.html>, viewable with his ABC Transcription Tools.\n",
"\n",
"We can load selected tunebooks from there, e.g. the King Street Sessions:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "32",
"metadata": {},
"outputs": [],
"source": [
"df = eskin.load_meta(\"kss\")\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "33",
"metadata": {},
"outputs": [],
"source": [
"df.group.value_counts()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "34",
"metadata": {},
"outputs": [],
"source": [
"from pyabc2 import Tune\n",
"\n",
"Tune(df.query(\"group == 'jigs'\").iloc[0].abc)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "35",
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display, Markdown\n",
"\n",
"url = \"https://michaeleskin.com/abctools/abctools.html?lzw=BoLgUAKiBiD2BOACCALApogMrAbhg8gGaICyArgM4CWAxmAEogUA2VADogFZUDmYAwiExUAXon4BDePFjNmYEiACcAegAcYTCACM6sAGkQAcTBGAogBFEFs0cQBBIwCFEAHwdG7zgCaI0333dzKxs7Rxo3RCc0DCd7F3MzRBBXMB5-PxVCFR4EpxUaFUDEdN80HgAjRAkAJmJ3Uszs3Id8wuL-F28nMKdAtIy0LJy8gqLIxvKq2olIipimnIxankjOxG7e+zdUoA\"\n",
"display(Markdown(f\"<{url}>\"))\n",
"eskin.load_url(url)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "venv",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
5 changes: 4 additions & 1 deletion pyabc2/sources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def load_url(url: str) -> Tune:

- Norbeck (``norbeck.nu/abc/``)
- The Session (``thesession.org``)
- Eskin ABC Tools (``michaeleskin.com/abctools/``)

See Also
--------
Expand All @@ -92,12 +93,14 @@ def load_url(url: str) -> Tune:
"""
from urllib.parse import urlsplit

from . import norbeck, the_session
from . import eskin, norbeck, the_session

res = urlsplit(url)
if res.netloc in norbeck._URL_NETLOCS:
return norbeck.load_url(url)
elif res.netloc in the_session._URL_NETLOCS:
return the_session.load_url(url)
elif res.netloc in eskin._URL_NETLOCS:
return eskin.load_url(url)
else:
raise NotImplementedError(f"loading URL from {res.netloc} not implemented.")
Loading