Rename anime files using ED2K hash and AniDB.
Project description
anipyrenamer
Current release: 1.2.0 — published on PyPI and tagged on GitHub.
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
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install anipyrenamer
The pip install anipyrenamer distribution does not ship .env.example. Copy the template from the public repository and save it as .env in a location below (never commit .env or real credentials).
Configuration
Put credentials and client strings in .env. Required for online mode:
ANIDB_USERNAME,ANIDB_PASSWORD,ANIDB_UDP_CLIENT,ANIDB_UDP_CLIENTVER,ANIDB_LOCAL_PORT
Optional:
ANIDB_API_KEY— enables AniDB UDPENCRYPT/ AES-encrypted sessions when set
Where .env is loaded: The CLI walks upward from your process current working directory and loads the first .env found, then loads the well-known file: Windows %APPDATA%\anipyrenamer\.env, Linux/macOS ~/.config/anipyrenamer/.env. The second load only fills variables that are still unset after the first. Variables already set in your environment are not overridden (same idea as python-dotenv with override=False).
For a stable location when you run from many folders, create the well-known directory if needed and place .env there.
Security
- Unix/macOS: Prefer
chmod 600on.env; the CLI warns if.envappears group- or world-readable. - Windows: The CLI does not change ACLs; keep
.envunder your user profile or restrict NTFS permissions. - AniDB UDP: With
ANIDB_API_KEYset, traffic usesENCRYPTafter setup. If it is missing or setup fails, the CLI warns and falls back to plaintext UDP — use a least-privilege AniDB account and avoid untrusted networks.
Cache: When the current directory or a parent contains pyproject.toml, the default database is project root .cache/anipyrenamer_cache.sqlite. Otherwise use the .cache subdirectory under the same well-known app config directory as .env (Windows: %APPDATA%\anipyrenamer\.cache\anipyrenamer_cache.sqlite, Unix: ~/.config/anipyrenamer/.cache/anipyrenamer_cache.sqlite). 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" --offline
anipyrenamer "C:\Videos\Anime" --plex
anipyrenamer "C:\Videos\Anime" -t "%title% S01E%epno%%ext%" -d "C:\Renamed"
anipyrenamer "C:\Videos\Anime" --mylist
Use anipyrenamer --help for all options.
Demo: --plex --mylist
This demo shows running anipyrenamer with Plex-style folders and the MyList wizard (--plex --mylist).
Confirmation prompts
Interactive confirmations use Prompt text (Y/n/a): — Y (default), n, or a (yes to all remaining).
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.
Changelog
See CHANGELOG.md for user-facing release history.
Contributing and issues
Report bugs and request features on the public repo's GitHub Issues.
Maintainers implement and track work in a separate private development repo. If a public report turns into scheduled implementation work, maintainers may link it to a private tracking issue while keeping the public issue as the user-facing thread for acknowledgement, release updates, and closure.
From source: Clone eunai/anipyrenamer and follow its README for optional editable install (pip install -e .), running tests when you hack on the code, and any extra dev dependencies.
Development note
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-1.2.0.tar.gz.
File metadata
- Download URL: anipyrenamer-1.2.0.tar.gz
- Upload date:
- Size: 61.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 |
c4f01d7568979fb3921818cf55fcb28dfbf1d5606e944641be571a8bb73d7b10
|
|
| MD5 |
81f9a1845b78b8f9698c9b2d022aff69
|
|
| BLAKE2b-256 |
625df662ac03adc05bedee729cb75de4918dec718263fe378d283dfd513838e5
|
Provenance
The following attestation bundles were made for anipyrenamer-1.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-1.2.0.tar.gz -
Subject digest:
c4f01d7568979fb3921818cf55fcb28dfbf1d5606e944641be571a8bb73d7b10 - Sigstore transparency entry: 1729578750
- Sigstore integration time:
-
Permalink:
eunai/anipyrenamer@2cb18c6476a399afa23e40d9dc9c289e5ef88b3b -
Branch / Tag:
refs/tags/v1.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@2cb18c6476a399afa23e40d9dc9c289e5ef88b3b -
Trigger Event:
push
-
Statement type:
File details
Details for the file anipyrenamer-1.2.0-py3-none-any.whl.
File metadata
- Download URL: anipyrenamer-1.2.0-py3-none-any.whl
- Upload date:
- Size: 40.3 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 |
4fd026a4466cd92ef767c8095c2c5e6c06b676313084013186882e2ebad0e3fc
|
|
| MD5 |
997132e82f39192e1161fcfe231d9667
|
|
| BLAKE2b-256 |
3da40f2c770532e33010c812797e50cfa013cfc7f222f3be227c751429bcf534
|
Provenance
The following attestation bundles were made for anipyrenamer-1.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-1.2.0-py3-none-any.whl -
Subject digest:
4fd026a4466cd92ef767c8095c2c5e6c06b676313084013186882e2ebad0e3fc - Sigstore transparency entry: 1729578967
- Sigstore integration time:
-
Permalink:
eunai/anipyrenamer@2cb18c6476a399afa23e40d9dc9c289e5ef88b3b -
Branch / Tag:
refs/tags/v1.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@2cb18c6476a399afa23e40d9dc9c289e5ef88b3b -
Trigger Event:
push
-
Statement type: