Animanager Documentation Release 0.8.0

Allen Li

March 26, 2016

Contents

1 Installation and configuration3 1.1 pip/PyPi installation...... 3 1.2 Manual installation...... 3 1.3 Database setup...... 3 1.4 Configuration...... 4

2 Quickstart 5 2.1 Adding a series...... 5 2.2 Searching your database...... 6 2.3 Watching shows...... 6 2.4 View stats...... 7 2.5 Other features...... 7

3 Configuration 9

4 Command reference 11 4.1 Global options...... 11 4.2 Anime commands...... 11 4.3 Manga commands...... 15

5 Database format 17 5.1 Manga support...... 17 5.2 More information...... 17

6 Selection menus 19

7 Indices and tables 23

i ii Animanager Documentation, Release 0.8.0

Project website: https://darkfeline.github.io/animanager/ This is the documentation for Animanager. Animanager is a simple anime watching and tracking program.

Contents 1 Animanager Documentation, Release 0.8.0

2 Contents CHAPTER 1

Installation and configuration

1.1 pip/PyPi installation

Animanager can be installed fairly easily using pip: $ pip3 install --user animanager

You need Python 3, pip for Python 3, and setuptools for this. Other dependencies will be installed automatically.

1.2 Manual installation

You need the following dependencies to run Animanager: • Python 3 • setuptools • tabulate Python 3 is needed to run Animanager. setuptools is neede for handling the installation. tabulate is needed for printing pretty tables (e.g., anime search). tabulate can be installed with pip: $ pip3 install --user tabulate

Animanager can be installed manually: $ python3 setup.py install --user

1.3 Database setup

Load the included database schema schema.sql into a SQLite3 database file at ~/.animanager/database.db: $ sqlite3 ~/.animanager/database.db '.read schema.sql'

3 Animanager Documentation, Release 0.8.0

1.4 Configuration

Copy the included configuration file config.ini to ~/.animanager/config.ini. Read the file and edit it accordingly. You will definitely need to edit the credentials for logging into MyAnimeList (MAL). This is used to pull information using MAL’s API. You may want to edit the player line to configure which video player to use. Examples: player= mpv--fullscreen player=

The [series] section is described in detail elsewhere; you do not need to touch it right now.

4 Chapter 1. Installation and configuration CHAPTER 2

Quickstart

This guide provides an example of Animanager usage.

2.1 Adding a series

First, add a series to track: $ animanager anime add "hidamari sketch"

Animanager will search MAL for series: 0: (1852) Hidamari Sketch 1: (3165) Hidamari Sketch Specials 2: (3604) Hidamari Sketch x 365 3: (6984) Hidamari Sketch x 365 Specials 4: (7062) Hidamari Sketch x 5: (9563) Hidamari Sketch x Specials 6: (11237) Hidamari Sketch x SP 7: (11239) Hidamari Sketch x Honeycomb 8: (17739) Hidamari Sketch: Sae Hiro Sotsugyou-hen 9: (20391) Hidamari Sketch: Chou Hidamatsuri Special 10: (28911) Hidamari Sketch Recap 11: (28913) Hidamari Sketch x 365 Recap 12: (28915) Hidamari Sketch x Recap [-1]>

This is Animanager’s selection interface, which you will see a lot. The [-1] means the default choice is -1, or the last item (in this case, 12). Another common default is [0], which indicates the first item. You can pick an item by typing its number and pressing Enter, or simply press Enter to pick the default choice. Next, choose the initial status: 0: plan to watch 1: watching 2: complete [0]>

For this guide, here we pick watching.

5 Animanager Documentation, Release 0.8.0

2.2 Searching your database

We can search our database to check our information: $ animanager anime search hidamari id name type ep_watched ep_total status date_started date_finished animedb_id ------1 Hidamari Sketch x 365 TV 0 13 watching 3604

This shows all of the information Animanager tracks.

2.3 Watching shows

Navigate to the directory where your files are: $ cd anime $ ls [SpoonSubs] Hidamari Sketch x 365 - 01 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 02 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 03 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 04 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 05 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 06 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 06 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 07 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 08 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 09 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 09 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 10 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 11 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 12 (DVD).mkv [SpoonSubs] Hidamari Sketch x 365 - 13 (DVD).mkv

Now we can use Animanager to automatically watch our series: $ animanager anime watch 0: (900) Hidamari Sketch x 365 (cur. 0, avail. 13) [-1]>

Animanager presents the choices for series to watch. Right now we only have one series, but we can add multiple and they will appear here provided that episodes are available. We see that we have currently watched no episodes and have 13 available to watch. Press Enter to select the default and only choice. Your configured video player will start and you can watch the episode. After the episode is over, the video player will close (provided that you are using an mpv-like player): Bump? [Y/n]

Animanager will prompt whether you want to bump your currently watched episode count. The default is yes, so just hit Enter. Alternatively, you can type n to keep your currently watched episode at 0. Animanager will automatically move the file to a “trash” directory to clean up the working directory. Now we’re back at the menu: 0: (900) Hidamari Sketch x 365 (cur. 1, avail. 12) [-1]>

6 Chapter 2. Quickstart Animanager Documentation, Release 0.8.0

You can keep watching, or quit using CTRL-. We quit to continue the tutorial. Let’s check our database: $ animanager anime search hidamari id name type ep_watched ep_total status date_started date_finished animedb_id ------1 Hidamari Sketch x 365 TV 1 13 watching 2015-09-29 3604

The episode count has been updated automatically, and the start date has been set as well.

2.4 View stats

Just for fun, Animanager also lets you view basic statistics: $ animanager anime stats By status: - complete: 638 - on hold: 0 - dropped: 165 - watching: 22 - plan to watch: 61 Total: 886 Episodes watched: 8715

2.5 Other features

Here’s an overview of some of Animanager’s features: • Version detection. Animanager will delete older versions of an episode and watch the latest version. • Date tracking of when you started and finished a series. • Updating series data via MAL (for example, if the total number of episodes for a series changes). I highly recommend you read through all of the documentation, which contains more information about Animanager’s features.

2.4. View stats 7 Animanager Documentation, Release 0.8.0

8 Chapter 2. Quickstart CHAPTER 3

Configuration

Animanager uses a configuration file in INI format. The default path of the file is ~/.animanager/config.ini, but can also be supplied as an option in the command line. See the included config.ini file for documentation and defaults.

9 Animanager Documentation, Release 0.8.0

10 Chapter 3. Configuration CHAPTER 4

Command reference

4.1 Global options

These go before any commands. --config=PATH Specify an alternate configuration file to use. Default is ~/.animanager/config.ini. --db=PATH Specify an alternate database file to use. Default is ~/.animanager/database.db. Make judicious use of the --help option: $ animanager --help $ animanager anime --help $ animanager anime add --help

4.2 Anime commands

These commands track and manage anime: $ animanager anime

I suggest you make an alias for your shell; for Bash, put this in your .bashrc: alias anime="animanager anime"

4.2.1 add

$ animanager anime add "series name search"

Add a series. You provide a string to search for, Animanager will search for it on MAL and prompt you for a series to add. You can add it with an initial status of “plan to watch”, “watching”, or “finished”. In the case of “finished”, Animanager will also set the watched episode count, and ask if you want to set the start and finished dates to today. In the case of “watching”, Animanager will also register the show (see register).

11 Animanager Documentation, Release 0.8.0

4.2.2 bump

$ animanager anime bump "series name search"

Animanager will selectively bump the episode watched count of one show. By default Animanager will only search “watching” shows; use the option --all to search from all incomplete shows. Animanager will set the show to watching, update start and end date, and update completion status automagically.

4.2.3 clean

$ animanager anime clean

Cleans up registered series in the config (see register). Removes all registered series in the config file that have been completed or dropped.

4.2.4 drop

$ animanager anime drop "series name search"

Animanager will set the status of one series to “dropped”. By default Animanager will only search “watching” and “on hold” shows; use the option --all to search from all incomplete shows.

4.2.5 hold

$ animanager anime hold "series name search"

Animanager will set the status of one series to “on hold”. By default Animanager will only search “watching” shows; use the option --all to search from all incomplete shows.

4.2.6 plan

$ animanager anime plan

Show series that have status “plan to watch”.

4.2.7 register

$ animanager anime register

Register a series. Registering series is used for the watch command. These are added to the configuration file under the [series] section. Here is an example: [series] 877 = Overlord.*?(?P[0-9]+)(v(?P[0-9]+))?

12 Chapter 4. Command reference Animanager Documentation, Release 0.8.0

These map the internal ID of a series in the database to a regular expression pattern that is used by Animanager to match files to series. The (?P[0-9]+) group captures the episode number of the file. The (?P[0-9]+) group captures the version of the file. If this group doesn’t match or isn’t present, the version defaults to 1. The register command will add a default regular expression pattern that should work most of the time. Depending on how your files are named, you may need to edit this pattern by hand in the configuration file. The patterns are tried sequentially. That means that for the following example, the second line will never match because the first line will match instead: [series] 1 = Overlord.*?(?P[0-9]+)(v(?P[0-9]+))? 2 = Overlord.*?Special.*?(?P[0-9]+)(v(?P[0-9]+))?

The first pattern match in the filename is used. The search is case insensitive. Refer to the Python documentation for more information about Python’s regular expression syntax. Adding a series as “watching” (see add) will register it automatically. In the case where you added as series as “plan to watch” or otherwise do not have a series registered in your config, this command can be used.

4.2.8 search

$ animanager anime search "series name search"

Print the databasea data for all series that match the given term. Example: $ animanager anime search yuusha id name type ep_watched ep_total status date_started date_finished animedb_id ------108 Densetsu no Yuusha no Densetsu TV 24 24 complete 8086 158 Hagure Yuusha no Estetica TV 12 12 complete 13161 291 Maoyuu Maou Yuusha TV 12 12 complete 2013-03-30 14833 526 Yuusha ni Narenakatta Ore wa Shibushibu Shuushoku wo Ketsui Shimashita. TV 12 12 complete 2013-10-08 2013-12-22 18677 601 Yuusha ni Narenakatta Ore wa Shibushibu Shuushoku wo Ketsui Shimashita. OVA OVA 1 1 complete 2014-03-14 2014-03-14 20545 739 Yuuki Yuuna wa Yuusha de Aru TV 12 12 complete 2014-10-17 2014-12-26 25519 856 Rokka no Yuusha TV 12 12 complete 2015-07-20 2015-09-20 28497

4.2.9 stats

$ animanager anime stats

Print database statistics. Example: $ animanager anime stats By status: - complete: 638 - on hold: 0 - dropped: 165 - watching: 22 - plan to watch: 61 Total: 886 Episodes watched: 8715

4.2. Anime commands 13 Animanager Documentation, Release 0.8.0

4.2.10 update

$ animanager anime update

Update series data in database. This command queries MAL for updated series information to use to update Animanager’s database. This command works on all series that do not have total episode count information yet or have status “watching”. Information that may be updated is the name of the series and total episode count.

4.2.11 watch

$ animanager anime watch

Watch anime. This is Animanager’s main command. All you have to do is run this command and watch anime; Animanager will update the database automagically. The following describes what the watch command does in detail. First, it takes reads the registered series information from the config and uses it to collate the files in the working directory. Files are matched to a series and episode number. Any files corresponding to episodes that have already been watch will be trashed (placed in a subdirectory to clean up the working directory). Next, it enters the main loop. At the beginning of the loop, you are presented with a menu of series to watch, series which have files available: 0: (900) Hidamari Sketch x 365 (cur. 1, avail. 11) (missing) 1: (877) Overlord (cur. 12, avail. 1) [-1](q)>

The menu displays the currently watched episode for each series and the number of episodes available to watch. In the event that the next episode in sequence is missing, the menu will display that too. After selecting a series, if there are multiple files available for the next series, Animanager will prompt you to choose a file to watch: 0: [BakedFish] World Trigger - 48 [720p][AAC].mp4 1: [Leopard-Raws] World Trigger - 48 RAW (ABC 1280x720 x264 AAC).mp4 [-1](q)>

This can be used for handling different release versions, different release groups, or subtitled vs un-subtitled files. Next, your selected video player will open automatically. After it terminates, Animanager will prompt you to update your tracking information (“bump”). If you choose to do so (the default), Animanager will increment your currently watched episode, handling any other necessary updates such as completion date and status, and trash all of the files for the watched episode. You can decline to bump, which will return you to the main menu without don’t anything else. This can be used to peek at an episode or a specific file, or to watch a different version of that episode. After this, the loop repeats. To exit, type q and press Enter.

14 Chapter 4. Command reference Animanager Documentation, Release 0.8.0

4.2.12 watching

$ animanager anime watching

Print the databasea data for all currently watching series.

4.3 Manga commands

Animanager doesn’t support manga yet.

4.3. Manga commands 15 Animanager Documentation, Release 0.8.0

16 Chapter 4. Command reference CHAPTER 5

Database format

All of Animanager’s data is stored in a SQLite3 database. You can do any manual adjustments, complex queries, or batch transformations of data directly on the database file using the SQLite3 command line or a SQLite3 browser such as sqlitebrowser. Make sure to enable foreign key support when working with the database: PRAGMA foreign_keys = ON

Here is a description of the columns in the anime table: id Internal ID. name Name of series. type Type of series. Can be TV, Movie, Special, OVA, ONA, or . Check the anime_types table. ep_watched Number of episodes currently watched. ep_total Total number of episodes. Can be NULL. status Your current watching status. Can be complete, on hold, dropped, watching, or plan to watch. Check the anime_statuses table. date_started Date you started watching, in this format: “2015-01-20”. date_finished Date you finished watching, in this format: “2015-01-20”. animedb_id This is the internal ID used by MAL for this series.

5.1 Manga support

Note that the database contains everything needed for manga as well. While Animanager does not currently support manga tracking, the database does support manga. You can manually enter information for manga until such time Animanager receives manga support.

5.2 More information

For even more detailed information, check the schema of the database, including the triggers and various type con- straints on the columns.

17 Animanager Documentation, Release 0.8.0

18 Chapter 5. Database format CHAPTER 6

Selection menus

This is Animanager’s selection menu: 0: (1852) Hidamari Sketch 1: (2694) Hidamari no Ki 2: (3165) Hidamari Sketch Specials 3: (3604) Hidamari Sketch x 365 4: (6984) Hidamari Sketch x 365 Specials 5: (7062) Hidamari Sketch x 6: (9563) Hidamari Sketch x Specials 7: (11237) Hidamari Sketch x SP 8: (11239) Hidamari Sketch x Honeycomb 9: (17739) Hidamari Sketch: Sae Hiro Sotsugyou-hen 10: (20391) Hidamari Sketch: Chou Hidamatsuri Special 11: (26099) Hidamari no Ie 12: (28911) Hidamari Sketch Recap 13: (28913) Hidamari Sketch x 365 Recap 14: (28915) Hidamari Sketch x Recap [-1]>

It is used in many places for making selections. Simply enter the index of the desired choice to select it. The bracketed index indicates the default should you press Enter without typing anything. This index is a Python array index, so negative values are acceptable. -1 means the last choice, -2 means the second to last choice, and so on. The selection menu also features simple commands. You can view the built-in help like so: [-1]> help

Documented commands (type help ): ======f help p r

Miscellaneous help topics: ======general

The f command lets you filter the selection menu: 0: (1852) Hidamari Sketch 1: (2694) Hidamari no Ki 2: (3165) Hidamari Sketch Specials 3: (3604) Hidamari Sketch x 365 4: (6984) Hidamari Sketch x 365 Specials

19 Animanager Documentation, Release 0.8.0

5: (7062) Hidamari Sketch x 6: (9563) Hidamari Sketch x Specials 7: (11237) Hidamari Sketch x SP 8: (11239) Hidamari Sketch x Honeycomb 9: (17739) Hidamari Sketch: Sae Hiro Sotsugyou-hen 10: (20391) Hidamari Sketch: Chou Hidamatsuri Special 11: (26099) Hidamari no Ie 12: (28911) Hidamari Sketch Recap 13: (28913) Hidamari Sketch x 365 Recap 14: (28915) Hidamari Sketch x Recap [-1]> f sketch 0: (1852) Hidamari Sketch 2: (3165) Hidamari Sketch Specials 3: (3604) Hidamari Sketch x 365 4: (6984) Hidamari Sketch x 365 Specials 5: (7062) Hidamari Sketch x 6: (9563) Hidamari Sketch x Specials 7: (11237) Hidamari Sketch x SP 8: (11239) Hidamari Sketch x Honeycomb 9: (17739) Hidamari Sketch: Sae Hiro Sotsugyou-hen 10: (20391) Hidamari Sketch: Chou Hidamatsuri Special 12: (28911) Hidamari Sketch Recap 13: (28913) Hidamari Sketch x 365 Recap 14: (28915) Hidamari Sketch x Recap [-1]> f 365 3: (3604) Hidamari Sketch x 365 4: (6984) Hidamari Sketch x 365 Specials 13: (28913) Hidamari Sketch x 365 Recap [-1]>

The p command prints the current menu in case it is not on your screen and you need to see it again: [-1]> p 3: (3604) Hidamari Sketch x 365 4: (6984) Hidamari Sketch x 365 Specials 13: (28913) Hidamari Sketch x 365 Recap [-1]>

The r command resets all search filters: [-1]> r 0: (1852) Hidamari Sketch 1: (2694) Hidamari no Ki 2: (3165) Hidamari Sketch Specials 3: (3604) Hidamari Sketch x 365 4: (6984) Hidamari Sketch x 365 Specials 5: (7062) Hidamari Sketch x 6: (9563) Hidamari Sketch x Specials 7: (11237) Hidamari Sketch x SP 8: (11239) Hidamari Sketch x Honeycomb 9: (17739) Hidamari Sketch: Sae Hiro Sotsugyou-hen 10: (20391) Hidamari Sketch: Chou Hidamatsuri Special 11: (26099) Hidamari no Ie 12: (28911) Hidamari Sketch Recap 13: (28913) Hidamari Sketch x 365 Recap 14: (28915) Hidamari Sketch x Recap [-1]>

The q command lets you cancel or quit the current selection, only if it is enabled for the current selection menu. If

20 Chapter 6. Selection menus Animanager Documentation, Release 0.8.0 quitting is enabled, a q will appear in the prompt: [-1](q)>

21 Animanager Documentation, Release 0.8.0

22 Chapter 6. Selection menus CHAPTER 7

Indices and tables

• genindex • modindex • search

23