skip to navigation
skip to content

guessit 2.0b4

GuessIt - a library for guessing information from video filenames.



GuessIt is a python library that extracts as much information as possible from a video filename.

It has a very powerful matcher that allows to guess a lot of metadata from a video using its filename only. This matcher works with both movies and tv shows episodes.

For example, GuessIt can do the following:

$ guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi"
For: Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi
GuessIt found: {
    "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"

Important note

GuessIt 2 has been rewriten from scratch and is currently in Beta. GuessIt is now a release name parser only, and support for additional features like hashes computations has been dropped.

To migrate from guessit 0.x or 1.x, please read MIGRATION.rst.

Previous version of GuessIt is still available in 1.x branch and using pip install guessit<2, but won’t be maintained anymore.


Installing GuessIt is simple with pip:

$ pip install guessit

Filename matcher

The filename matcher is based on Rebulk and is able to recognize many properties from the filename. Guessed values are cleaned up and given in a readable format which may not match exactly the raw filename.


guessit can be use from command line:

$ guessit
usage: guessit [-h] [-t TYPE] [-n] [-Y] [-D] [-L ALLOWED_LANGUAGES]
               [-G EXPECTED_GROUP] [-f INPUT_FILE] [-v] [-P SHOW_PROPERTY]
               [-a] [-j] [-y] [-p] [-V] [--version]
               [filename [filename ...]]

positional arguments:
  filename              Filename or release name to guess

optional arguments:
  -h, --help            show this help message and exit

  -t TYPE, --type TYPE  The suggested file type: movie, episode. If undefined,
                        type will be guessed.
  -n, --name-only       Parse files as name only, considering "/" and "\" like
                        other separators.
  -Y, --date-year-first
                        If short date is found, consider the first digits as
                        the year.
  -D, --date-day-first  If short date is found, consider the second digits as
                        the day.
                        Allowed language (can be used multiple times)
                        Allowed country (can be used multiple times)
  -E, --episode-prefer-number
                        Guess "serie.213.avi" as the episode 213. Without this
                        option, it will be guessed as season 2, episode 13
                        Expected title to parse (can be used multiple times)
                        Expected release group (can be used multiple times)

  -f INPUT_FILE, --input-file INPUT_FILE
                        Read filenames from an input text file. File should
                        use UTF-8 charset.

  -v, --verbose         Display debug output
                        Display the value of a single property (title, series,
                        video_codec, year, ...)
  -a, --advanced        Display advanced information for filename guesses, as
                        json output
  -j, --json            Display information for filename guesses as json
  -y, --yaml            Display information for filename guesses as yaml

  -p, --properties      Display properties that can be guessed.
  -V, --values          Display property values that can be guessed.
  --version             Display the guessit version.

It can also be used as a python module:

>>> from guessit import guessit
>>> guessit(u'Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi')  # doctest: +ALLOW_UNICODE
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.

GuessIt only accept unicode string, so you need to use u prefix for input string on python 2.


This project is hosted on GitHub:

Docs will be available soon availabe ReadTheDocs.


GuessIt is under active development, and contributions are more than welcome!

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
  2. Fork the repository on Github to start making your changes to the 2.x branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. :)


GuessIt is licensed under the LGPLv3 license.


2.0b4 (2015-11-24)

  • Add expected-group option.
  • Add validation rule for single digit episode to avoid false positives.
  • Add verbose option.
  • Fix expected-title option.
  • Better unicode support in expected-group/expected-title option.

2.0b3 (2015-11-15)

  • Add support for part with no space before number.
  • Avoid uuid and crc32 collision with season/episode properties.
  • Add better space support for season/episode properties.
  • Ensure date property is found when conflicting with season/episode properties.
  • Fix IndexError when input has a closing group character with no opening one before.
  • Add --type option.
  • Add rebulk implicit option support.

2.0b2 (2015-11-14)

  • Add python 2.6 support.

2.0b1 (2015-11-11)

  • Enhance title guessing.
  • Upgrade rebulk to 0.6.1.
  • Rename properCount to proper_count
  • Avoid crash when using -p/-V option with --yaml and yaml module is not available.

2.0a4 (2015-11-09)

  • Add -p/-V options to display properties and values that can be guessed.

2.0a3 (2015-11-08)

  • Allow rebulk customization in API module.

2.0a2 (2015-11-07)

  • Raise TypeError instead of AssertionError when non text is given to guessit API.
  • Fix packaging issues with previous release blocking installation.

2.0a1 (2015-11-07)

File Type Py Version Uploaded on Size
guessit-2.0b4.tar.gz (md5) Source 2015-11-24 68KB
  • Downloads (All Versions):
  • 495 downloads in the last day
  • 3163 downloads in the last week
  • 15177 downloads in the last month