File: migration.md

package info (click to toggle)
guessit 3.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,196 kB
  • sloc: python: 4,731; sh: 10; makefile: 7
file content (158 lines) | stat: -rw-r--r-- 4,980 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
Migration
=========

Guessit 2 has been rewritten from scratch. You can find in this file all information required to perform a migration from previous version `0.x` or `1.x`.

API
---

`guess_video_info`, `guess_movie_info` and `guess_episode_info` have been removed in favor of a unique function `guessit`.

Example:

    >>> from guessit import guessit
    >>> guessit('Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi')
    MatchesDict([('title', 'Treme'), ('season', 1), ('episode', 3), ('episode_title', 'Right Place, Wrong Time'), ('format', 'HDTV'), ('video_codec', 'XviD'), ('release_group', 'NoTV'), ('container', 'avi'), ('mimetype', 'video/x-msvideo'), ('type', 'episode')])

`MatchesDict` is a dict that keeps matches ordering.

Command line options can be given as dict or string to the second argument.

Properties
----------

Some properties have been renamed.

-   `series` is now `title`.
-   `title` is now `episode_title` (for `episode` `type` only).
-   `episodeNumber` is now `episode`.
-   `bonusNumber` is now `bonus`
-   `filmNumber` is now `film`
-   `cdNumber` is now `cd ` and `cdNumberTotal` is now `cd_count`
-   `idNumber` is now `uuid`

`episodeList` and `partList` have been removed. `episode_number` and `part` properties that can now contains an `int` or a `list[int]`.

All info `type`, like `seriesinfo` and `movieinfo`. You can check directly `nfo` value in `container` property.

All `camelCase` properties have been renamed to `underscore_case`.

-   `releaseGroup` is now `release_group`
-   `episodeCount` is now `episode_count`
-   `episodeDetails` is now `episode_details`
-   `episodeFormat` is now `episode_format`
-   `screenSize` is now `screen_size`
-   `videoCodec` is now `video_codec`
-   `videoProfile` is now `video_profile`
-   `videoApi` is now `video_api`
-   `audioChannels` is now `audio_channels`
-   `audioCodec` is now `audio_codec`
-   `audioProfile` is now `audio_profile`
-   `subtitleLanguage` is now `subtitle_language`
-   `bonusTitle` is now `bonus_title`
-   `properCount` is now `proper_count`

Options
-------

Some options have been removed.

-   `-X DISABLED_TRANSFORMERS`, `-s, --transformers`

    There's no transformer anymore.

-   `-S EXPECTED_SERIES`

    As `series` was renamed to `title`, use `-T EXPECTED_TITLE` instead.

-   `-G EXPECTED_GROUP`

    GuessIt is now better to guess release group, so this option has been removed.

-   `-d, --demo`

    Probably not that useful.

-   `-i INFO, --info INFO`

    Features related to this option have been removed.

-   `-c, --split-camel`, `-u, --unidentified`, `-b, --bug`

    Will be back soon... (work in progress)

Other GuessIt `1.x` options have been kept.

Output
------

Output produced by `guessit` api function is now an instance of [OrderedDict](https://docs.python.org/2/library/collections.html#collections.OrderedDict). Property values are automatically ordered based on filename, and you can still use this output as a default python `dict`.

If multiple values are available for a property, value in the dict will be a `list` instance.

`country` 2-letter code is not added to the title anymore. As `country` is added to the returned guess dict, it's up to the user to edit the guessed title.

Advanced display option (`-a, --advanced`) output is also changed. It now list `Match` objects from [Rebulk](https://github.com/Toilal/rebulk), and may display duplicates that would have been merged in standard output.:

    $ guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi" -a
    For: Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi
    GuessIt found: {
        "title": {
            "value": "Treme",
            "raw": "Treme.",
            "start": 0,
            "end": 6
        },
        "season": {
            "value": 1,
            "raw": "1",
            "start": 6,
            "end": 7
        },
        "episode": {
            "value": 3,
            "raw": "03",
            "start": 8,
            "end": 10
        },
        "episode_title": {
            "value": "Right Place, Wrong Time",
            "raw": ".Right.Place,.Wrong.Time.",
            "start": 10,
            "end": 35
        },
        "format": {
            "value": "HDTV",
            "raw": "HDTV",
            "start": 35,
            "end": 39
        },
        "video_codec": {
            "value": "XviD",
            "raw": "XviD",
            "start": 40,
            "end": 44
        },
        "release_group": {
            "value": "NoTV",
            "raw": "-NoTV",
            "start": 44,
            "end": 49
        },
        "container": {
            "value": "avi",
            "raw": ".avi",
            "start": 49,
            "end": 53
        },
        "mimetype": {
            "value": "video/x-msvideo",
            "start": 53,
            "end": 53
        },
        "type": {
            "value": "episode",
            "start": 53,
            "end": 53
        }
    }