comicbox.readinglists.match ¶
Match a reading list against the comics in a directory.
Each comic becomes an entry with entry_from_comic. Matching goes in two passes. First every entry takes each comic it shares a strict key with (entry_keys: an issue id, the series name, start year or volume and issue, or, weakest, the series name, cover year and issue). Then each entry that found none tries its name variants in order, among the comics no entry took strictly. Either way a comic is refused when it carries an id from a database the entry has a different id from, or a cover year more than a year off the entry’s, and a match on the volume key is refused for another year. A comic that shares only the cover-year key is refused for another series year than the entry’s or its strong matches’, and is ambiguous beside cover-year matches of another volume: listed, never tagged. An entry with no key matches nothing. A missing entry reports the comics refused that a person may want to see (Refused). The matching is pure; reading the directory is separate.
ArcAction ¶
Bases: StrEnum
What tagging one comic with a list’s arc would do.
Source code in comicbox/readinglists/match.py
464 465 466 467 468 469 | |
ArcChange dataclass ¶
The arc one comic should carry, and what it carries now.
arc is the name to write under: the comic’s own spelling when it already has the arc in another case, so it never gets the arc twice. number is None for an unordered list. current is the number the comic has, when it has the arc.
Source code in comicbox/readinglists/match.py
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | |
Found dataclass ¶
The comics that are entry position (from 0), in path order.
volumes holds the discriminators its ambiguous cover-year matches carry, start years or volume numbers, when it has any.
Source code in comicbox/readinglists/match.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
FoundBy ¶
Bases: StrEnum
How a comic was found: the strength of the key that matched.
Source code in comicbox/readinglists/match.py
50 51 52 53 54 55 56 57 58 59 60 61 | |
strict property ¶
Whether this is an entry_keys match, not a name variant.
FoundComic dataclass ¶
One comic an entry was found in, and how.
ambiguous marks a cover-year match beside others of another volume: match lists it, and does not choose between them.
Source code in comicbox/readinglists/match.py
64 65 66 67 68 69 70 71 72 73 74 75 | |
MatchResult dataclass ¶
What a directory has of a list, and what it is missing, by position.
refused holds, for missing entries only, the comics refused for another volume or cover year that no entry found, by position, then path.
Source code in comicbox/readinglists/match.py
120 121 122 123 124 125 126 127 128 129 130 131 132 | |
Refused dataclass ¶
A comic refused for missing entry position (from 0), and why.
Source code in comicbox/readinglists/match.py
111 112 113 114 115 116 117 | |
RefusedReason ¶
Bases: StrEnum
Why a comic that looked like a missing entry was refused.
Source code in comicbox/readinglists/match.py
102 103 104 105 106 107 108 | |
find_arc(tags, name) ¶
Find a comic’s arc of this name, in any case.
Source code in comicbox/readinglists/match.py
490 491 492 493 494 495 496 497 498 499 | |
match_comics(reading_list, comics) ¶
Find each of a list’s entries among some comics’ tags.
comics maps each comic’s path to its tags, as a ReadResult holds them. Strict matches are settled for the whole list first, so a comic one entry is strictly is never another entry’s variant. A comic of one issue in several files is found in all, and an issue the list holds twice is found in the same comics both times. A cover-year match is refused beside strong matches of another volume, and is ambiguous beside cover-year matches of another volume; see _Index. Each missing entry reports the comics _Index.refused finds for it that no entry found.
Source code in comicbox/readinglists/match.py
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
plan_arcs(reading_list, comics, result, name, *, variants=False) ¶
Plan the arc each found comic should carry, in path order.
The arc is named name; its number is the entry’s place in an ordered list, the first place for an issue the list reads twice, in every copy of it. Only strict matches are planned, unless variants, and never an ambiguous one.
Source code in comicbox/readinglists/match.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | |