{"id":31462042,"url":"https://github.com/rec/zoialib","last_synced_at":"2025-10-01T15:49:01.527Z","repository":{"id":316903281,"uuid":"1065269640","full_name":"rec/zoialib","owner":"rec","description":"Command line librarian for Empress ZOIA patches","archived":false,"fork":false,"pushed_at":"2025-09-27T23:01:27.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T00:22:13.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T11:38:04.000Z","updated_at":"2025-09-27T23:01:30.000Z","dependencies_parsed_at":"2025-09-28T00:22:15.746Z","dependency_job_id":null,"html_url":"https://github.com/rec/zoialib","commit_stats":null,"previous_names":["rec/zlib","rec/zoialib"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rec/zoialib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fzoialib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fzoialib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fzoialib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fzoialib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rec","download_url":"https://codeload.github.com/rec/zoialib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fzoialib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277866762,"owners_count":25891280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-01T02:00:09.286Z","response_time":88,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-01T15:49:00.159Z","updated_at":"2025-10-01T15:49:01.519Z","avatar_url":"https://github.com/rec.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔊 `zoialib`: a patch librarian for ZOIA 🔊\n\n## What is `zoialib`?\n\nInspired by\n[`repatch.py`](https://patchstorage.com/repatch-py-organize-and-auto-name-your-patches/)\n([source](https://gist.github.com/BenQuigley/7b4c70cac1183a16aed89b8b209364a2)),\n`zoialib` is a command line program that prepares patch directories to download\nto ZOIA.\n\n## How to install `zoialib`\n\nYou can use `pip`, `uv`, `poetry`, `conda` or any other tool for installing\nPython modules.\n\n```\npip install zoialib\n\n# or\n\nuv add zoialib\n\n# or\n\npoetry add zoialib\n\n# or\n\nconda install zoialib\n```\n\n## Some background on ZOIA patch directories\n\nZOIA patches are files, organized by name. Here's a ZOIA directory with\neight patches:\n\n```\n000_zoia_Gainfully_fun.bin\n001_zoia_Rephrase_v1_0.bin\n002_zoia_SAMPLE.bin\n003_zoia_Always_On.bin\n004_zoia_Angry_robots.bin\n005_zoia_Elemental_Ring.bin\n006_zoia_Loop_Noodle-680ef8977c75f.bin\n007_zoia_Tiny_Orchestra.bin\n```\n\nThe first three letters of a ZOIA patch file name are the _slot number_, three digits\nlike `096`.\n\nThe next six letters are the fixed _marker string_ `_zoia_`.\n\nThen then there's the _patch name_, e.g. `Gainfully_fun`, and the patch file always ends\nwith the _suffix_ `.bin`.\n\nFinally, patch slots must always be in consecutive order, with no gaps. If don't you want\nany patch in a slot, you must fill it with\na blank patch [like these](https://patchstorage.com/64-blank-zoia-patches/).\n\n## What problems does `zoialib` solve?\n\nThe slot number is part of the ZOIA patch file name, which is very convenient for\nconfiguring ZOIA, but is clumsy and time-consuming if you have a lot of patches and you\nonly download some of them at a time to ZOIA.\n\n`zoialib` assumes that only the _patch name_ determines what is in the patch, and\nhandles keeping track of the slots for you.\n\nNOTE: if you have a setup where two files like, say, `000_zoia_synth.bin` and\n`001_zoia_synth.bin` have the same patch name `synth` but are _different_ patches, **do\nnot use this program** as it might destroy your data!\n\n## The commands\n\n`zoialib` has two commands.\n\n* `zoialib prepare` prepares a ZOIA patch directory\n* `zoialib rename` renames patch files to remove the slot number and marker string\n\n### `zoialib rename`\n\n`zoialib rename FILE [FILE...]` simply renames one or more ZOIA patch files to just use\nthe patch name.\n\nFor example, `zoialib rename 004_zoia_Angry_robots.bin` would rename the file\n`004_zoia_Angry_robots.bin` to `Angry_robots.bin`.\n\nVery useful in bulk operations using a \"glob\", like `zoialib rename */*.bin`, but\nremember that you could wreak havoc this way, so be careful.\n\n### `zoialib prepare`\n\n`zoialib prepare FILE [FILE...]` prepares ZOIA patch files into a ZOIA patch directory.\n\n#### Basic example:\n\n```\n$ zoialib prepare --verbose downloads/000*.bin\nMaking output directory zoia-2025-09-28_12-30-41\nCopying downloads/000_zoia_Gainfully_fun.bin to zoia-2025-09-28_12-30-41/000_zoia_Gainfully_fun.bin\nCopying downloads/000_zoia_Rephrase_v1_0.bin to zoia-2025-09-28_12-30-41/001_zoia_Rephrase_v1_0.bin\nCopying downloads/000_zoia_SAMPLE.bin to zoia-2025-09-28_12-30-41/002_zoia_SAMPLE.bin\n3 files copied to zoia-2025-09-28_12-30-41\n```\n\n#### Slot assignment\n\nYou can put individual patches into a specific slot using `:`. If this generates gaps,\nthey get filled in with a blank patch:\n\n```\n$ zoialib prepare -v  --output=output downloads/one.bin:2 downloads/two.bin:1  downloads/three.bin:5\n\nMaking output directory output\nCopying /Users/tom/code/zoialib/zoia_empty.bin to output/000_zoia_.bin\nCopying downloads/two.bin:1 to output/001_zoia_Rephrase_v1_0.bin\nCopying downloads/one.bin:2 to output/one.bin\nCopying /Users/tom/code/zoialib/zoia_empty.bin to output/003_zoia_.bin\nCopying /Users/tom/code/zoialib/zoia_empty.bin to output/004_zoia_.bin\nCopying downloads/three.bin:5 to output/005_three.bin\n```\n\n#### The slot list file\n\nIf you like your slot numbers to remain stable, for example if you are sending program\nchanges to ZOIA, there's a nifty feature called the _slot list file_.  by default named\n`slot_list.toml`, automatically created and maintained by `zoialib`.\n\nRunning `zoialib prepare` with the `--update-slots-file`/`-u` flag updates the slot list\nfile with the slot assignments from the current run so the next time these patches\nare seeing, they can get the same patch number if possible.\n\n```\n$ zoialib prepare --update-slots-file -v -o output one.bin two.bin three.bin\nCopying one.bin to output/000_zoia_one.bin\nCopying two.bin to output/001_zoia_two.bin\nCopying three.bin to output/002_zoia_three.bin\n\n$ # Now it remembers the slots, like this:\n\n$ zoialib prepare -v -o output three.bin one.bin two.bin\nCopying one.bin to output/000_zoia_one.bin\nCopying two.bin to output/001_zoia_two.bin\nCopying three.bin to output/002_zoia_three.bin\n```\n\nThe slot list file is in [TOML](https://toml.io/en/), a language for configuration files\nthat is designed to be easy for people to edit without making mistakes.\n\n## Useful features common to both commands\n\n### Flags\n\n* `--help` or `-h` prints the help message for the command\n  * Example: `zoialib rename --help` or `zoialib rename -h`.\n\n* `--verbose`/`-v` makes the program print more information\n\n* `--dry-run`/`-d` turns on `--verbose`, but doesn't actually execute the commands\n\n### Text files containing patch file names\n\nInstead of typing individual patch names, you can also use text files, ending in `.txt`,\nwhere each line is a patch file name or another text file.\n\nBlank lines and everything after the `#` comment character are ignored. Wildcard \"globs\"\n`*`, `?`, `[` and `]`, are expanded.\n\nExample:\n\n```\n$ cat my-patches.txt\n\n# For Friday's show\n\ndownloads/one.bin:2\ndownloads/two.bin:1  @ I hate this patch.\n\n# downloads/seventeen.bin:17\ndownloads/three.bin:5\n\n$ zoialib prepare -v -o=output my-patches.txt\n\nCopying /Users/tom/code/zoialib/zoia_empty.bin to output/000_zoia_.bin\nCopying downloads/two.bin:1 to output/001_zoia_Rephrase_v1_0.bin\nCopying downloads/one.bin:2 to output/one.bin\nCopying /Users/tom/code/zoialib/zoia_empty.bin to output/003_zoia_.bin\nCopying /Users/tom/code/zoialib/zoia_empty.bin to output/004_zoia_.bin\nCopying downloads/three.bin:5 to output/005_three.bin\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frec%2Fzoialib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frec%2Fzoialib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frec%2Fzoialib/lists"}