Skip to main content

weltschmerz

Maintain a (local) database for anime files. Contains scripts to hash and sort anime files, as well as looking up files in AniDB utilizing the yumemi Python module.

This project is licensed under the terms of the MIT license. These third-party files are included:

  • pyselect.py: Copyright 2013 Matthew Behrens, under the terms of the MIT license.
  • sorttable.js: Copyright 2007 Stuart Langridge, under the terms of the X11/MIT license.

See also LICENSE.md

Requirements

  • Python 3 (>=3.6)
  • yumemi Python module (optional, for interacting with AniDB)
  • SQL database
    • PostgreSQL works, and is recommended
    • SQLite3 works, but does not support the numeric collation, order for T/S/P/O episodes might be wrong

Configuration file

Copy weltschmerz.cfg.example to weltschmerz.cfg or $HOME/.config/weltschmerz/weltschmerz.cfg and adjust as necessary.

Import AniDB MyList export

It is recommended to import your MyList first, as that will populate the Anime, Episode, and File tables.

  1. Request an xml-plain-full export of your MyList at AniDB - MyList Export
  2. Download export file
  3. Extract the export file:tar xf <mylist_export>.tgz
  4. Parse the export and populate the local database: ./parse_mylist_export.py --mylist-xml-files anime/a*.xml

Hash local files

weltschmerz files hash --folder /anime/by-id/00/00/01/ --folder /anime/by-id/00/00/02/

Add files to your AniDB MyList

Lookup the local files in AniDB and add them to your MyList, if they are present in AniDB. weltschmerz anidb lookup-files --folder /anime/by-id/00 --folder /anime/by-id/01 --debug --online --add-to-mylist --mylist-state 4

Deduplicate local files

Interactively deduplicate local files, as well as set the modified time of duplicate files to the oldest one. weltschmerz files remove-duplicates --preferred-directory-pattern /anime/by-id

Sort local files

Sort/Move files, this will put the files into folders according to their anime ids (padded to 6 digits) from AniDB. e.g. files for Seikai no Monshou (anime id 1) will be put in <target_basedir>/by-id/00/00/01.

weltschmerz files sort --source-basedir /anime/unsorted --target-basedir /anime

Create symlinks for local anime folders

To be able to look for local anime by name, create symlinks to point to the folders created by "Sort local files". This creates a by-name folder under the target basedir.

  1. Download anime titles dump (XML) from AniDB, see AniDB Wiki - API/Anime Titles for instructions.
  2. Decompress the title dump: gunzip anime-titles.xml.gz
  3. Run script to create the symlinks: ./animetitle.py anime-titles.xml /anime/

Metadata

Release files for weltschmerz 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for weltschmerz 1.0.1
File Size Uploaded
weltschmerz-1.0.1.tar.gz 20.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for weltschmerz 1.0.1
File Interpreter ABI Platform
weltschmerz-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 45.5 kB

Release files / weltschmerz-1.0.1.tar.gz

Download URL weltschmerz-1.0.1.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0138ea4504b08677e66143b843bd3a0ea08d2978104e7b290d7132aa312c9039
BLAKE2b-256 checksum
How to use checksums
ee4f295a0c29cd78873cb9ce84e408dba8ad3124d53637f91819f7d4d31de30d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / weltschmerz-1.0.1-py3-none-any.whl

Download URL weltschmerz-1.0.1-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
985c902c8eece27cb00ce441a56da33868c96ddd28e9519ef44bf27185a33c56
BLAKE2b-256 checksum
How to use checksums
4f481976bdd889ce0998f532e3ab5853236bf4e7844bb050035b0497d9befda3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page