{ "info": { "author": "Rato", "author_email": "ratoaq2@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Multimedia :: Video", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "CleanIt\n==========\nSubtitles extremely clean.\n\n.. image:: https://img.shields.io/pypi/v/cleanit.svg\n :target: https://pypi.python.org/pypi/cleanit\n :alt: Latest Version\n\n.. image:: https://travis-ci.org/ratoaq2/cleanit.svg?branch=master\n :target: https://travis-ci.org/ratoaq2/cleanit\n :alt: Travis CI build status\n\n.. image:: https://img.shields.io/github/license/ratoaq2/cleanit.svg\n :target: https://github.com/ratoaq2/cleanit/blob/master/LICENSE\n :alt: License\n\n:Project page: https://github.com/ratoaq2/cleanit\n\n**CleanIt** is a command line tool (written in python) that helps you to keep your subtitles clean. You can specify rules to detect subtitle entries to be removed or patterns to be replaced. Simple text matching or complex regex can be used.\n\nUsage\n-----\nCLI\n^^^\nClean subtitles::\n\n $ cleanit --config my-config.yml my-subtitle.srt\n Collected 1 subtitles\n Saving \n Saved \n\nLibrary\n^^^^^^^\nHow to clean subtitles in a specific path using a specific configuration:\n\n.. code:: python\n\n from cleanit.api import clean_subtitle, save_subtitle\n from cleanit.config import Config\n from cleanit.subtitle import Subtitle\n\n subtitle = Subtitle('/subtitle/path')\n config = Config.from_file('/config/path')\n if clean_subtitle(subtitle, config.rules):\n save_subtitle(subtitle)\n\nYAML Configuration file\n^^^^^^^^^^^^^^^^^^^^^^^\nThe yaml configuration file has 2 main sections: *templates* and *groups*.\n\n- **Templates** can help you to define common configuration snippets to be used in several groups.\n- **Groups**: where you can define your rules.\n\n.. code:: yaml\n\n # Reference:\n # type: [text*, regex]\n # match: [contains*, exact, startswith, endswith]\n # flags: [ignorecase, dotall, multiline, locale, unicode, verbose]\n # whitelist: no* \n # rules:\n # - sometext\n # - (\\b)(\\d{1,2})x(\\d{1,2})(\\b): {replacement: \\1S\\2E\\3\\4, type: regex, match: contains, flags: [unicode], whitelist: no}\n \n \n templates:\n common:\n type: text\n match: contains\n \n groups:\n # Groups can have any name, in this case 'blacklist' we have all the rules to remove subtitle entries\n blacklist:\n template: common\n rules:\n # Removes any subtitle entry that contains the word FooBar\n - FooBar\n \n # Removes any subtitle entry that contains the pattern S00E00\n # Example:\n # My Series S01E02\n - \\bs\\d{2}\\s?e\\d{2}\\b: {type: regex, flags: ignorecase}\n \n # Removes any subtitle entry that is exactly the word: 'Ah' or 'Oh' (with 1 or more h)\n # Example:\n # Ohhh!\n - ((Ah+)|(Oh+))\\W?: {match: exact}\n \n # The group 'tidy' has all rules to replace certain patterns in your subtitles.\n tidy:\n template: common\n type: regex\n rules:\n # Description: Replace extra spaces to a single space\n # Example:\n # Foo bar.\n # to\n # Foo bar.\n - \\s{2,}: ' '\n \n # Description: Add space when starting phrase with '-'. It ignores tags, such as , \n # Example:\n # -Francine, what has happened?\n # -What has happened? You tell me!\n # to\n # - Francine, what has happened?\n # - What has happened? You tell me!\n - '(?:^(|(?:\\<\\w\\>)))-([''\"]?\\w+)': { replacement: '\\1- \\2', flags: [multiline, unicode] }\n\n\\* The default value if none is defined\n\n\n\nCleanIt will try to load configuration file from ~/.config/cleanit/config.yml if no configuration file is defined.\n\nChangelog\n---------\n\n0.2.1\n^^^^^\n**release date:** 2016-02-28\n* Adding guess encoding back without python-magic dependency.\n\n0.2\n^^^^^\n**release date:** 2016-02-27\n* Removing chardet and python-magic dependencies. Either encoding is specified or it should be guessed by pysrt\n\n0.1\n^^^^^\n**release date:** 2015-10-16\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ratoaq2/cleanit", "keywords": "subtitle subtitles clean blacklist replace", "license": "Apache License 2.0", "maintainer": null, "maintainer_email": null, "name": "cleanit", "package_url": "https://pypi.org/project/cleanit/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cleanit/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ratoaq2/cleanit" }, "release_url": "https://pypi.org/project/cleanit/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Subtitles extremely clean", "version": "0.2.1" }, "last_serial": 1980480, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2cfc982981d604c47dd8a02155b2c905", "sha256": "a0666d14c83036d2b2a8894625eb40f4e4d988351623174e71ff5f7fcad50d38" }, "downloads": -1, "filename": "cleanit-0.1.tar.gz", "has_sig": false, "md5_digest": "2cfc982981d604c47dd8a02155b2c905", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7382, "upload_time": "2015-10-16T21:34:15", "url": "https://files.pythonhosted.org/packages/bd/58/527aa1c8c06e361fed511e424e41ffae23b36424d3ef5a3514ee3cd877d8/cleanit-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "0e9527acd1f0cbbaf045b2366cbd7b8d", "sha256": "4988c126b7a9a7c0d9676d759cef995a08bcb586702b1c2fe9dc3c932b78c1a1" }, "downloads": -1, "filename": "cleanit-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0e9527acd1f0cbbaf045b2366cbd7b8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13002, "upload_time": "2015-10-16T21:50:46", "url": "https://files.pythonhosted.org/packages/db/10/b0c1b330c60d982d9bd0439c5a47e4a67c909f177c48779f1e32308c36df/cleanit-0.1.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "b750b9d4201d04f49da78f0924018254", "sha256": "c7a8483024042e799fcf925277a94dbeb595a1a3a08a01785ae56bab15048c76" }, "downloads": -1, "filename": "cleanit-0.2.tar.gz", "has_sig": false, "md5_digest": "b750b9d4201d04f49da78f0924018254", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11243, "upload_time": "2016-02-27T16:46:02", "url": "https://files.pythonhosted.org/packages/c5/cd/86a40b50377ea7b3303bed4f1d71cf18d5c3908b0ecba87f2d1ca74cc92c/cleanit-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0f109cb3e1399ee078c723c8ce7007fb", "sha256": "6a7d05fbaa1506235036514edd6ceabe7e407de5557269bbd7162d0a8bd95086" }, "downloads": -1, "filename": "cleanit-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0f109cb3e1399ee078c723c8ce7007fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11581, "upload_time": "2016-02-28T11:56:27", "url": "https://files.pythonhosted.org/packages/01/b9/62cadbaa776e83b722c7ac7d53341107df36a771ef293b28934c5fd01094/cleanit-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0f109cb3e1399ee078c723c8ce7007fb", "sha256": "6a7d05fbaa1506235036514edd6ceabe7e407de5557269bbd7162d0a8bd95086" }, "downloads": -1, "filename": "cleanit-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0f109cb3e1399ee078c723c8ce7007fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11581, "upload_time": "2016-02-28T11:56:27", "url": "https://files.pythonhosted.org/packages/01/b9/62cadbaa776e83b722c7ac7d53341107df36a771ef293b28934c5fd01094/cleanit-0.2.1.tar.gz" } ] }