🍱 A patch librarian for the Empress ZOIA 🍱
Project description
🔊 zoialib: a patch librarian for ZOIA 🔊
What is zoialib?
Inspired by
repatch.py
(source),
zoialib is a command line program that prepares patch directories to download
to ZOIA.
How to install zoialib
You can use pip, uv, poetry, conda or any other tool for installing
Python modules.
pip install zoialib
# or
uv add zoialib
# or
poetry add zoialib
# or
conda install zoialib
Some background on ZOIA patch directories
ZOIA patches are files, organized by name. Here's a ZOIA directory with eight patches:
000_zoia_Gainfully_fun.bin
001_zoia_Rephrase_v1_0.bin
002_zoia_SAMPLE.bin
003_zoia_Always_On.bin
004_zoia_Angry_robots.bin
005_zoia_Elemental_Ring.bin
006_zoia_Loop_Noodle-680ef8977c75f.bin
007_zoia_Tiny_Orchestra.bin
The first three letters of a ZOIA patch file name are the slot number, three digits
like 096.
The next six letters are the fixed marker string _zoia_.
Then then there's the patch name, e.g. Gainfully_fun, and the patch file always ends
with the suffix .bin.
Finally, patch slots must always be in consecutive order, with no gaps. If don't you want any patch in a slot, you must fill it with a blank patch like these.
What problems does zoialib solve?
The slot number is part of the ZOIA patch file name, which is very convenient for configuring ZOIA, but is clumsy and time-consuming if you have a lot of patches and you only download some of them at a time to ZOIA.
zoialib assumes that only the patch name determines what is in the patch, and
handles keeping track of the slots for you.
NOTE: if you have a setup where two files like, say, 000_zoia_synth.bin and
001_zoia_synth.bin have the same patch name synth but are different patches, do
not use this program as it might destroy your data!
The commands
zoialib has two commands.
zoialib prepareprepares a ZOIA patch directoryzoialib renamerenames patch files to remove the slot number and marker string
zoialib rename
zoialib rename FILE [FILE...] simply renames one or more ZOIA patch files to just use
the patch name.
For example, zoialib rename 004_zoia_Angry_robots.bin would rename the file
004_zoia_Angry_robots.bin to Angry_robots.bin.
Very useful in bulk operations using a "glob", like zoialib rename */*.bin, but
remember that you could wreak havoc this way, so be careful.
zoialib prepare
zoialib prepare FILE [FILE...] prepares ZOIA patch files into a ZOIA patch directory.
Basic example:
$ zoialib prepare --verbose downloads/000*.bin
Making output directory zoia-2025-09-28_12-30-41
Copying downloads/000_zoia_Gainfully_fun.bin to zoia-2025-09-28_12-30-41/000_zoia_Gainfully_fun.bin
Copying downloads/000_zoia_Rephrase_v1_0.bin to zoia-2025-09-28_12-30-41/001_zoia_Rephrase_v1_0.bin
Copying downloads/000_zoia_SAMPLE.bin to zoia-2025-09-28_12-30-41/002_zoia_SAMPLE.bin
3 files copied to zoia-2025-09-28_12-30-41
Slot assignment
You can put individual patches into a specific slot using :. If this generates gaps,
they get filled in with a blank patch:
$ zoialib prepare -v --output=output downloads/one.bin:2 downloads/two.bin:1 downloads/three.bin:5
Making output directory output
Copying /Users/tom/code/zoialib/zoia_empty.bin to output/000_zoia_.bin
Copying downloads/two.bin:1 to output/001_zoia_Rephrase_v1_0.bin
Copying downloads/one.bin:2 to output/one.bin
Copying /Users/tom/code/zoialib/zoia_empty.bin to output/003_zoia_.bin
Copying /Users/tom/code/zoialib/zoia_empty.bin to output/004_zoia_.bin
Copying downloads/three.bin:5 to output/005_three.bin
The slot list file
If you like your slot numbers to remain stable, for example if you are sending program
changes to ZOIA, there's a nifty feature called the slot list file. by default named
slot_list.toml, automatically created and maintained by zoialib.
Running zoialib prepare with the --update-slots-file/-u flag updates the slot list
file with the slot assignments from the current run so the next time these patches
are seeing, they can get the same patch number if possible.
$ zoialib prepare --update-slots-file -v -o output one.bin two.bin three.bin
Copying one.bin to output/000_zoia_one.bin
Copying two.bin to output/001_zoia_two.bin
Copying three.bin to output/002_zoia_three.bin
$ # Now it remembers the slots, like this:
$ zoialib prepare -v -o output three.bin one.bin two.bin
Copying one.bin to output/000_zoia_one.bin
Copying two.bin to output/001_zoia_two.bin
Copying three.bin to output/002_zoia_three.bin
The slot list file is in TOML, a language for configuration files that is designed to be easy for people to edit without making mistakes.
Useful features common to both commands
Flags
-
--helpor-hprints the help message for the command- Example:
zoialib rename --helporzoialib rename -h.
- Example:
-
--verbose/-vmakes the program print more information -
--dry-run/-dturns on--verbose, but doesn't actually execute the commands
Text files containing patch file names
Instead of typing individual patch names, you can also use text files, ending in .txt,
where each line is a patch file name or another text file.
Blank lines and everything after the # comment character are ignored. Wildcard "globs"
*, ?, [ and ], are expanded.
Example:
$ cat my-patches.txt
# For Friday's show
downloads/one.bin:2
downloads/two.bin:1 @ I hate this patch.
# downloads/seventeen.bin:17
downloads/three.bin:5
$ zoialib prepare -v -o=output my-patches.txt
Copying /Users/tom/code/zoialib/zoia_empty.bin to output/000_zoia_.bin
Copying downloads/two.bin:1 to output/001_zoia_Rephrase_v1_0.bin
Copying downloads/one.bin:2 to output/one.bin
Copying /Users/tom/code/zoialib/zoia_empty.bin to output/003_zoia_.bin
Copying /Users/tom/code/zoialib/zoia_empty.bin to output/004_zoia_.bin
Copying downloads/three.bin:5 to output/005_three.bin
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
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 zoialib-0.8.0.tar.gz.
File metadata
- Download URL: zoialib-0.8.0.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dd26be8107dd38e1ea14e56bfa8f8ada5a6c93b475509878250b6fc27dab3f9
|
|
| MD5 |
ff0b41363491d181e7871aa4e6b0637d
|
|
| BLAKE2b-256 |
01c360dc1012fea1c1f0e63ee2885036a94dbc556904c8ec57c1b4fdfa3bd676
|
File details
Details for the file zoialib-0.8.0-py3-none-any.whl.
File metadata
- Download URL: zoialib-0.8.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6387d3e1db994b9101ba69d7b7d68ce370047a2d76023cab9dda92fdce1c661
|
|
| MD5 |
c65266c35a361a1cb804011dd43ff459
|
|
| BLAKE2b-256 |
85c0b30bb1fd711be7324b40ccdd8b759b595f7664019afacc45fd92cfffb6d8
|