Rename anime files using ED2K hash and AniDB.
Project description
anipyrenamer
anipyrenamer is a command-line tool that renames anime files using ED2K hash lookups from AniDB, with local SQLite caching for faster reruns and offline support.
It fits alongside local media libraries (Plex/Jellyfin folders, plain disk collections): you point it at files or folders, it resolves titles and episode metadata from AniDB, then renames in place or into a destination tree.
Requirements
- Python 3.13+
- An AniDB account and UDP API client registration (for online lookup). You can use
--offlinewhen the SQLite cache already has the rows you need.
Install
# From the repository root (the directory that contains pyproject.toml).
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
cp .env.example .env
# edit .env — never commit secrets
For a minimal install without dev dependencies: pip install -e .
Optional helper scripts are in scripts/ (install.sh / install.bat, install-dev.*, setup-venv.*).
Configuration
Put credentials and client strings in .env (see .env.example). Required for online mode:
ANIDB_USERNAME,ANIDB_PASSWORD,ANIDB_UDP_CLIENT,ANIDB_UDP_CLIENTVER,ANIDB_LOCAL_PORT
Optional:
ANIDB_API_KEY(when UDP encryption is enabled)
Where .env is loaded: project/package directory and parents first, then a well-known config path: Windows %APPDATA%\anipyrenamer\.env, Linux/macOS ~/.config/anipyrenamer/.env.
Cache: When a parent directory contains pyproject.toml, the default database is project root .cache/anipyrenamer_cache.sqlite. Otherwise it lives under the same config directory as .env. Override with --db.
Usage
anipyrenamer <path> [paths...]
Examples:
anipyrenamer "C:\Videos\Anime" --dry-run
anipyrenamer "C:\Videos\Anime"
anipyrenamer "C:\Videos\Anime" --yes
anipyrenamer "C:\Videos\Anime" -t "%title% S01E%epno%%ext%" -d "C:\Renamed"
anipyrenamer "C:\Videos\Anime" --mylist
Use anipyrenamer --help for all options.
Confirmation prompts
The rename-apply confirmation uses Prompt text (Y/n/a): — Y (default), n, or a (yes to all remaining).
The --mylist wizard uses Prompt text (Y/n): — Y (default) or n, with no "yes to all": every MyList prompt is an independent yes/no, and the final Apply MyList updates? prompt is the only confirmation that writes to your AniDB MyList.
MyList storage states
When you run --mylist and choose to set storage, the menu is 0-indexed and the number you type is the AniDB MyList state code that gets saved:
| Key | Meaning |
|---|---|
0 |
Unknown/None |
1 |
Internal (on hdd) |
2 |
External (on cd/dvd) |
3 |
Deleted |
4 |
Remote (NAS/cloud) |
5 |
Exit (abort without writing) |
Only the state code is written; no free-text storage name is sent. Verified on 2026.06.26 against the live AniDB MyList UI. Legacy AniDB clients that label 4 as "shared" or 5 as "release" are out of date — AniDB repurposed those codes after retiring P2P sharing.
Platforms
Developed and tested on Windows and Unix-like systems (Linux, macOS). Paths in examples use Windows style where helpful; adjust for your OS.
Troubleshooting
See docs/runbook.md for exit codes, common failures, and safe reruns.
Contributing and issues
Report bugs and request features via the project issue tracker on GitHub.
Development
Parts of this codebase were written or refactored with AI-assisted coding tools, alongside manual design, testing, and review. Human maintainers remain responsible for behavior and releases.
License
Distributed under the MIT License. Dependency licenses vary; review them when preparing redistributions (wheel, bundle, installer).
Project details
Release history Release notifications | RSS feed
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 anipyrenamer-2.2.0.tar.gz.
File metadata
- Download URL: anipyrenamer-2.2.0.tar.gz
- Upload date:
- Size: 75.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05cbc38fba079198a380667fe040438f345b25ee23f498d5d5d6a728cf4c7d3b
|
|
| MD5 |
341597396a9371b037cd7c46496bb76d
|
|
| BLAKE2b-256 |
98e33e253840f806a304eb1abe75e574343eea3f0a274df4c516080ad6b63753
|
Provenance
The following attestation bundles were made for anipyrenamer-2.2.0.tar.gz:
Publisher:
pypi-publish.yml on eunai/anipyrenamer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anipyrenamer-2.2.0.tar.gz -
Subject digest:
05cbc38fba079198a380667fe040438f345b25ee23f498d5d5d6a728cf4c7d3b - Sigstore transparency entry: 2194914171
- Sigstore integration time:
-
Permalink:
eunai/anipyrenamer@b442074b0fc0508bee59937c408d65c9796f642c -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/eunai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b442074b0fc0508bee59937c408d65c9796f642c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file anipyrenamer-2.2.0-py3-none-any.whl.
File metadata
- Download URL: anipyrenamer-2.2.0-py3-none-any.whl
- Upload date:
- Size: 45.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a58f00f2d11758eea311bdbdaec280800cb8175b2b92f1c02928fb837570e5dd
|
|
| MD5 |
f1f2a684450d18a7950d4632416a3b39
|
|
| BLAKE2b-256 |
95c9def3fe2804a602fcc6c98e77cc91b723b444fb2c1d23cb6699a56b0afcf0
|
Provenance
The following attestation bundles were made for anipyrenamer-2.2.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on eunai/anipyrenamer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anipyrenamer-2.2.0-py3-none-any.whl -
Subject digest:
a58f00f2d11758eea311bdbdaec280800cb8175b2b92f1c02928fb837570e5dd - Sigstore transparency entry: 2194914206
- Sigstore integration time:
-
Permalink:
eunai/anipyrenamer@b442074b0fc0508bee59937c408d65c9796f642c -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/eunai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b442074b0fc0508bee59937c408d65c9796f642c -
Trigger Event:
workflow_dispatch
-
Statement type: