trakit


Nametrakit JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/ratoaq2/trakit
SummaryGuess additional information from track titles
upload_time2024-06-23 06:01:56
maintainerNone
docs_urlNone
authorRato
requires_python<4.0.0,>=3.8.1
licenseMIT
keywords video mkv audio subtitles srt pgs sdh cc sup sub metadata movie episode tv track shows series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TrakIt
Guess additional information from track titles

[![Latest
Version](https://img.shields.io/pypi/v/trakit.svg)](https://pypi.python.org/pypi/trakit)

[![tests](https://github.com/ratoaq2/trakit/actions/workflows/test.yml/badge.svg)](https://github.com/ratoaq2/trakit/actions/workflows/test.yml)

[![License](https://img.shields.io/github/license/ratoaq2/trakit.svg)](https://github.com/ratoaq2/trakit/blob/master/LICENSE)

  - Project page  
    <https://github.com/ratoaq2/trakit>

## Info

**TrakIt** is a track name parser.
It is a tiny library created to solve a very specific problem.
It's very common that video files do not have precise metadata information, 
where you can have multiple subtitle tracks tagged as **Portuguese**, 
but one of them is actually **Brazilian Portuguese**:
```json lines
{
  "codec": "SubRip/SRT",
  "id": 19,
  "properties": {
    "codec_id": "S_TEXT/UTF8",
    "codec_private_length": 0,
    "default_track": false,
    "enabled_track": true,
    "encoding": "UTF-8",
    "forced_track": false,
    "language": "por",
    "language_ietf": "pt",
    "number": 20,
    "text_subtitles": true,
    "track_name": "Português",
    "uid": 160224385584803173
  }
}

{
  "codec": "SubRip/SRT",
  "id": 20,
  "properties": {
    "codec_id": "S_TEXT/UTF8",
    "codec_private_length": 0,
    "default_track": false,
    "enabled_track": true,
    "encoding": "UTF-8",
    "forced_track": false,
    "language": "por",
    "language_ietf": "pt",
    "number": 21,
    "text_subtitles": true,
    "track_name": "Português (Brasil)",
    "uid": 1435945803220205
  }
}
```
Or you have multiple audio tracks in **English**,
but one of them is **British English** (`British English Forced (PGS)`) and others are **American English**
(`American English (PGS)`)

Given a track name, **TrakIt** can guess the language:

```bash
>> trakit "Português (Brasil)"
{
  "language": "pt-BR"
}
```

**TrakIt** is also able to identify:
* SDH: Subtitles for the Deaf or Hard of Hearing
* Forced flag
* Closed captions
* Alternate version tracks
* Commentary tracks

```bash
>> trakit "British English (SDH) (PGS)"
{
  "language": "en-GB",
  "hearing_impaired": true
}

>> trakit "English CC (SRT)"
{
  "language": "en",
  "closed_caption": true
}

>> trakit "Cast and Crew Commentary (English AC3 Stereo)"
{
  "language": "en",
  "commentary": true
}

>> trakit "Français Forced (SRT)"
{
  "language": "fr",
  "forced": true
}
```

All available CLI options:
```bash
>> trakit --help
usage: trakit [-h] [-l EXPECTED_LANGUAGE] [--debug] [-y] [--version] value

positional arguments:
  value                 track title to guess

options:
  -h, --help            show this help message and exit

Configuration:
  -l EXPECTED_LANGUAGE, --expected-language EXPECTED_LANGUAGE
                        The expected language to be guessed

Output:
  --debug               Print information for debugging trakit and for reporting bugs.
  -y, --yaml            Display output in yaml format

Information:
  --version             show program's version number and exit
```


**TrakIt** is not a release parser. Use [GuessIt](https://github.com/guessit-io/guessit)

**TrakIt** is not a video metadata extractor.
Use [KnowIt](https://github.com/ratoaq2/knowit).
KnowIt already uses **trakit** to enhance the extracted information

## Installation

**TrakIt** can be installed as a regular python module by running:

    $ [sudo] pip install trakit

For a better isolation with your system you should use a dedicated
virtualenv or install for your user only using the `--user` flag.

## Data
* Available languages are the same supported by [Diaoul/babelfish](https://github.com/Diaoul/babelfish)
* Localized country names were fetched from [mledoze/countries](https://github.com/mledoze/countries)
* Localized language names were fetched from [mozilla/language-mapping-list](https://github.com/mozilla/language-mapping-list)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ratoaq2/trakit",
    "name": "trakit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "video, mkv, audio, subtitles, srt, pgs, sdh, cc, sup, sub, metadata, movie, episode, tv, track, shows, series",
    "author": "Rato",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/2c/4d/93938a1c55f685cb12176759e645a7d048c8ba07678d98e58e4b29d10955/trakit-0.2.2.tar.gz",
    "platform": null,
    "description": "# TrakIt\nGuess additional information from track titles\n\n[![Latest\nVersion](https://img.shields.io/pypi/v/trakit.svg)](https://pypi.python.org/pypi/trakit)\n\n[![tests](https://github.com/ratoaq2/trakit/actions/workflows/test.yml/badge.svg)](https://github.com/ratoaq2/trakit/actions/workflows/test.yml)\n\n[![License](https://img.shields.io/github/license/ratoaq2/trakit.svg)](https://github.com/ratoaq2/trakit/blob/master/LICENSE)\n\n  - Project page  \n    <https://github.com/ratoaq2/trakit>\n\n## Info\n\n**TrakIt** is a track name parser.\nIt is a tiny library created to solve a very specific problem.\nIt's very common that video files do not have precise metadata information, \nwhere you can have multiple subtitle tracks tagged as **Portuguese**, \nbut one of them is actually **Brazilian Portuguese**:\n```json lines\n{\n  \"codec\": \"SubRip/SRT\",\n  \"id\": 19,\n  \"properties\": {\n    \"codec_id\": \"S_TEXT/UTF8\",\n    \"codec_private_length\": 0,\n    \"default_track\": false,\n    \"enabled_track\": true,\n    \"encoding\": \"UTF-8\",\n    \"forced_track\": false,\n    \"language\": \"por\",\n    \"language_ietf\": \"pt\",\n    \"number\": 20,\n    \"text_subtitles\": true,\n    \"track_name\": \"Portugu\u00eas\",\n    \"uid\": 160224385584803173\n  }\n}\n\n{\n  \"codec\": \"SubRip/SRT\",\n  \"id\": 20,\n  \"properties\": {\n    \"codec_id\": \"S_TEXT/UTF8\",\n    \"codec_private_length\": 0,\n    \"default_track\": false,\n    \"enabled_track\": true,\n    \"encoding\": \"UTF-8\",\n    \"forced_track\": false,\n    \"language\": \"por\",\n    \"language_ietf\": \"pt\",\n    \"number\": 21,\n    \"text_subtitles\": true,\n    \"track_name\": \"Portugu\u00eas (Brasil)\",\n    \"uid\": 1435945803220205\n  }\n}\n```\nOr you have multiple audio tracks in **English**,\nbut one of them is **British English** (`British English Forced (PGS)`) and others are **American English**\n(`American English (PGS)`)\n\nGiven a track name, **TrakIt** can guess the language:\n\n```bash\n>> trakit \"Portugu\u00eas (Brasil)\"\n{\n  \"language\": \"pt-BR\"\n}\n```\n\n**TrakIt** is also able to identify:\n* SDH: Subtitles for the Deaf or Hard of Hearing\n* Forced flag\n* Closed captions\n* Alternate version tracks\n* Commentary tracks\n\n```bash\n>> trakit \"British English (SDH) (PGS)\"\n{\n  \"language\": \"en-GB\",\n  \"hearing_impaired\": true\n}\n\n>> trakit \"English CC (SRT)\"\n{\n  \"language\": \"en\",\n  \"closed_caption\": true\n}\n\n>> trakit \"Cast and Crew Commentary (English AC3 Stereo)\"\n{\n  \"language\": \"en\",\n  \"commentary\": true\n}\n\n>> trakit \"Fran\u00e7ais Forced (SRT)\"\n{\n  \"language\": \"fr\",\n  \"forced\": true\n}\n```\n\nAll available CLI options:\n```bash\n>> trakit --help\nusage: trakit [-h] [-l EXPECTED_LANGUAGE] [--debug] [-y] [--version] value\n\npositional arguments:\n  value                 track title to guess\n\noptions:\n  -h, --help            show this help message and exit\n\nConfiguration:\n  -l EXPECTED_LANGUAGE, --expected-language EXPECTED_LANGUAGE\n                        The expected language to be guessed\n\nOutput:\n  --debug               Print information for debugging trakit and for reporting bugs.\n  -y, --yaml            Display output in yaml format\n\nInformation:\n  --version             show program's version number and exit\n```\n\n\n**TrakIt** is not a release parser. Use [GuessIt](https://github.com/guessit-io/guessit)\n\n**TrakIt** is not a video metadata extractor.\nUse [KnowIt](https://github.com/ratoaq2/knowit).\nKnowIt already uses **trakit** to enhance the extracted information\n\n## Installation\n\n**TrakIt** can be installed as a regular python module by running:\n\n    $ [sudo] pip install trakit\n\nFor a better isolation with your system you should use a dedicated\nvirtualenv or install for your user only using the `--user` flag.\n\n## Data\n* Available languages are the same supported by [Diaoul/babelfish](https://github.com/Diaoul/babelfish)\n* Localized country names were fetched from [mledoze/countries](https://github.com/mledoze/countries)\n* Localized language names were fetched from [mozilla/language-mapping-list](https://github.com/mozilla/language-mapping-list)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Guess additional information from track titles",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://github.com/ratoaq2/trakit",
        "Repository": "https://github.com/ratoaq2/trakit"
    },
    "split_keywords": [
        "video",
        " mkv",
        " audio",
        " subtitles",
        " srt",
        " pgs",
        " sdh",
        " cc",
        " sup",
        " sub",
        " metadata",
        " movie",
        " episode",
        " tv",
        " track",
        " shows",
        " series"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "35843f0d7e86b746f3917df5d807cd8556825b9c028f0fbf63cdb3f941a8ba16",
                "md5": "17f7c5fe37e9758753685d445daf365b",
                "sha256": "82ea3e6a27c2a053c4d59df4325f78687c6b88a016b181e65294a5d81514f2e7"
            },
            "downloads": -1,
            "filename": "trakit-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "17f7c5fe37e9758753685d445daf365b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 18841,
            "upload_time": "2024-06-23T06:01:54",
            "upload_time_iso_8601": "2024-06-23T06:01:54.513083Z",
            "url": "https://files.pythonhosted.org/packages/35/84/3f0d7e86b746f3917df5d807cd8556825b9c028f0fbf63cdb3f941a8ba16/trakit-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c4d93938a1c55f685cb12176759e645a7d048c8ba07678d98e58e4b29d10955",
                "md5": "ef6aa0150d3f9c3f8e2ac223f5e84412",
                "sha256": "42e8b7af9949620d12647cd4b9801125d04a15a9ad8bb832230b26b78a723700"
            },
            "downloads": -1,
            "filename": "trakit-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ef6aa0150d3f9c3f8e2ac223f5e84412",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 17709,
            "upload_time": "2024-06-23T06:01:56",
            "upload_time_iso_8601": "2024-06-23T06:01:56.757729Z",
            "url": "https://files.pythonhosted.org/packages/2c/4d/93938a1c55f685cb12176759e645a7d048c8ba07678d98e58e4b29d10955/trakit-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-23 06:01:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ratoaq2",
    "github_project": "trakit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "trakit"
}
        
Elapsed time: 0.25535s