... for paper implementations, look for the
Code button in
Publications.
△◻⬠⬡🞅 drbutil for basic Geometry Processing in Python
For fast prototyping and research code I love to use
Python in combination with
NumPy.
To make things easier, I've compiled a collection of frequently used stuff in a small library, which you can install with
pip install drbutil
as a

or checkout the source here 👉
drbutil.
♫ iTunes Scripting
I manage my offline music collection with iTunes on Windows.
This is sometimes kind of a hassle, so I have automated some tasks with Python.
Maybe these scripts also come in handy for someone with a similar setup.
Background and useful links for iTunes scripting:
Rename Files
If not given, this script implements uniform filename conventions, which simplifies other tasks.
Replace Mp3s with Lossless
Sometimes I want to replace old Mp3 files in my library with lossless versions.
Here we can just change the file location attribute of the library entry if there exists a lossless version in the same directory as the Mp3.
Add new Tracks in Album Order
I like to sort my library by "
Date added" with new entries at the end.
However, adding an album-folder in Windows with drag-and-drop or even the iTunes import function will add the tracks in a randomly shuffled order to the library.
To have the album tracks show up in their correct order, one would need to add them one by one.
Adding multiple albums or discographies can become quite tedious.
With this script, tracks can be added automatically in their original order.
You can even choose a date and time (i.e., original release dates), when the tracks should show up in the library.
This is crucial for the upcoming scripting operation.
Unfortunately one can not set the "
Date Added" field of a track, so we actually have to change the Windows system time.
Transfer "Played Count"
In older parts of my library I messed up the album order when adding files.
So when replacing old Mp3s with new lossless version, I can fix that.
Therefore I use the script above to sort in the lossless files at the same date the lossy ones were added.
But I want to keep the "
Played Count" attribute of the tracks.
This script scans the library for occurrences of a track, sums up all "
Played Counts" and adds them to the new lossless track.
Run with
--preview to see if everything looks okay.
Afterwards we can delete the old Mp3 files and library entries.