{ "info": { "author": "Sergey Poznyakoff", "author_email": "gray@gnu.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup" ], "description": "MediaWiki Markup Translator\n===========================\nThis package provides Python framework for translating WikiMedia\narticles to various formats. The present version supports\nconversions to plain text, HTML, and Texinfo formats.\n\nA command line converter utility is included.\n\nClasses\n=======\n\nclass ``WikiMarkup``\n--------------------\nA base class for all translator classes. Unless you plan extending\nwikitrans, you will never have to create objects of this\nclass. Instead, you will be using one of its derived classes.\n\nConstructor arguments common for all derived classes:\n\nfilename = *name*\n The file *name* is opened and used for input.\nfile = *fd*\n An already opened file *fd* is used for input.\ntext = *string*\n Input is taken from *string*, line by line.\n\nlang = *code*\n Specifies language version. Default is ``en``. This variable can be\n referred to as ``%(lang)s`` in the keyword arguments below.\nhtml_base = *url*\n Base URL for cross-references. Default is\n ``http://%(lang)s.wikipedia.org/wiki/``.\nimage_base = *url*\n Base URL for images. Default is\n ``http://upload.wikimedia.org/wikipedia/commons/thumb/a/bf``\nmedia_base = *url*\n Base URL for media files. Default is\n ``http://www.mediawiki.org/xml/export-0.3``\n\ndebug_level = *int*\n Debug verbosity level (0 - no debug info, 100 - excessively\n copious debug messages). Default is 0.\n\nstrict = *bool*\n Strict parsing mode. Throw exceptions on syntax errors. Default is False.\n\nclass ``TextWikiMarkup``\n------------------------\nTranslates material in Wiki markup language to plain text. Usage::\n\n from WikiTrans.wiki2text import TextWikiMarkup\n\n markup = TextWikiMarkup(filename='input.txt')\n markup.parse()\n print(str(markup))\n\nSpecific constructor arguments:\n\nwidth = *N*\n Limit output width to *N* columns. Default is 78. \nshow_urls = *bool*\n Whether or not to show the URLs links refer to. If *bool* is\n ``True`` (the default), a URL will be displayed in parentheses next\n to the link text. If ``False``, only the link text will be displayed. \n\nclass ``TextWiktionaryMarkup``\n------------------------------\nTranslate material from wiktionary to plain text form. This is\nsupposed to provide a wiktionary-specific form of\n``TextWikiMarkup``. Currently, this class differs from\n``TextWikiMarkup`` only in that the default value for ``html_base``\nis ``http://%(lang)s.wikipedia.org/wiki/``.\n\n\nclass ``TexiWikiMarkup``\n------------------------\nTranslate Wiki markup to Texinfo source. Usage::\n\n from WikiTrans.wiki2texi import TexiWikiMarkup\n\n markup = TexiWikiMarkup(filename='input.txt')\n markup.parse()\n print(str(markup))\n\nTwo markup-specific keywords control the sectioning model used.\n\nsectioning_model = *model*\n Selects the Texinfo sectioning model for the output\n document. Possible values are:\n\n ``numbered``\n Top of document is marked with ``@top``. Headings (``=``, ``==``,\n ``===``, etc) produce ``@chapter``,\n ``@section``, ``@subsection``, etc.\n ``unnumbered``\n Unnumbered sectioning: ``@top``, ``@unnumbered``, ``@unnumberedsec``,\n ``@unnumberedsubsec``.\n ``appendix``\n Sectioning suitable for appendix entries: ``@top``, ``@appendix``,\n ``@appendixsec``, ``@appendixsubsec``, etc.\n ``heading``\n Use heading directives to reflect sectioning: ``@majorheading``,\n ``@chapheading``, ``@heading``, ``@subheading``, etc.\n\nsectioning_start = *n*\n Shift resulting heading level by *n* positions. For example, supposing\n ``sectioning_model=numbered``, ``== A ==`` will produce ``@section\n A`` on output. If ``sectioning_start=1`` is also given, this\n directive will produce ``@subsection A`` instead.\n\nclass ``HtmlWikiMarkup``\n------------------------\nTranslates Wiki markup to HTML. Usage::\n\n from WikiTrans.wiki2html import HtmlWikiMarkup\n\n markup = HtmlWikiMarkup(filename='input.txt')\n markup.parse()\n print(str(markup))\n\nSupported keywords are same as for ``WikiMarkup`` class.\n\nclass ``HtmlWiktionaryMarkup``\n------------------------------\nTranslate material from wiktionary to HTML form. This is\nsupposed to provide a wiktionary-specific form of\n``HtmlWikiMarkup``. Currently both classes are equivalent, except that\nthe default value for ``html_base`` in ``HtmlWiktionaryMarkup``\nis ``http://%(lang)s.wikipedia.org/wiki/``.\n\nThe ``wikitrans`` utility\n=========================\nThis command line utility converts the supplied text to selected\noutput format. The usage syntax is::\n\n wikitrans [OPTIONS] ARG\n\nIf ARG looks like a URL, the wiki text to be converted will be\ndownloaded from that URL.\n\nOtherwise, if the ``--base-url=URL`` option is given, ARG is treated as\nthe name of the page to get from the WikiMedia istallation at ``URL``.\n\nOtherwise, ARG is treated as the name of the file to read wiki\nmaterial from.\n\nExamples::\n\n wikitrans text.wiki\n\n wikitrans --base-url http://en.wiktionary.org door\n\n wikitrans https://en.wiktionary.org/wiki/Special:Export/door\n\nOptions are:\n\n``--version``\n Show program's version number and exit.\n``-h``, ``--help``\n Show a short usage summary and exit.\n``-v``, ``--verbose``\n Verbose operation.\n``-I ITYPE``, ``--input-type=ITYPE``\n Set input document type. *ITYPE* is one of: ``default`` or ``wiktionary``.\n``-t OTYPE``, ``--to=OTYPE``, ``--type=OTYPE``\n Set output document type (``html`` (the default), ``texi``,\n ``text``, or ``dump``).\n``-l LANG``, ``--lang=LANG``\n Set input document language.\n``-o KW=VAL``, ``--option=KW=VAL``\n Pass the keyword argument ``KW=VAL`` to the parser class constructor.\n``-d DEBUG``, ``--debug=DEBUG``\n Set debug level (0..100).\n``-D``, ``--dump``\n Dump parse tree and exit; same as ``--type=dump``.\n``-b URL``, ``--base-url=URL``\n Set base url. \n\nNote: when using ``--base-url`` or passing URL as an argument (2nd and 3rd\nuse cases above), if the URL is in 'wikipedia.org' or 'wiktionary.org'\ndomain, the options ``--input-type``, and ``--lang`` are set automatically.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.gnu.org.ua/projects/wikitrans", "keywords": "mediawiki markup translation", "license": "GPL License", "maintainer": "", "maintainer_email": "", "name": "wikitrans", "package_url": "https://pypi.org/project/wikitrans/", "platform": "any", "project_url": "https://pypi.org/project/wikitrans/", "project_urls": { "Homepage": "http://www.gnu.org.ua/projects/wikitrans" }, "release_url": "https://pypi.org/project/wikitrans/1.3/", "requires_dist": null, "requires_python": "", "summary": "Wiki markup translator.", "version": "1.3" }, "last_serial": 4229893, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "34c3b14bef15fc1269bf3fa844708f95", "sha256": "3dd60b8164d97e8ee7f0a10e7b824a454bbf4b9e13b2f672503a74532f619e6e" }, "downloads": -1, "filename": "wikitrans-1.0.tar.gz", "has_sig": false, "md5_digest": "34c3b14bef15fc1269bf3fa844708f95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67936, "upload_time": "2018-08-19T14:27:07", "url": "https://files.pythonhosted.org/packages/48/6f/f4cd47cda74e1ea5a4edacaa3de3e552a6bb92f5fb20ef89d9712fd7c4b0/wikitrans-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "c5a81aade487839ff2cd423c168b9338", "sha256": "3a53212e92e1d0536f34ca26bee6d0cf5dd82ba3eb195a664b60a485592b5621" }, "downloads": -1, "filename": "wikitrans-1.1.tar.gz", "has_sig": false, "md5_digest": "c5a81aade487839ff2cd423c168b9338", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67618, "upload_time": "2018-08-24T20:04:22", "url": "https://files.pythonhosted.org/packages/58/07/00a1ff87db3386178d96b40f2837b3f84c196be18e89b49468b892f4b0cc/wikitrans-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "9e5d48ce4486817ae2b135869d5471a7", "sha256": "4d5902211cfd6301a5ee8c42bebdea7b5ab3ae055bef2b24bfe1cc91efa5acd0" }, "downloads": -1, "filename": "wikitrans-1.2.tar.gz", "has_sig": false, "md5_digest": "9e5d48ce4486817ae2b135869d5471a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67690, "upload_time": "2018-08-27T08:12:19", "url": "https://files.pythonhosted.org/packages/35/f9/c3ab354b55556e6a8c381c2513894ac859caa8711fc71d63d68598e394fd/wikitrans-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "e0f17da982d8336868add46e69e080f5", "sha256": "fd5c8b28ae8292901aaf3c71df1bbe31e040f2909fb497e8116b8e7663d9f6c3" }, "downloads": -1, "filename": "wikitrans-1.3.tar.gz", "has_sig": false, "md5_digest": "e0f17da982d8336868add46e69e080f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68204, "upload_time": "2018-09-01T19:32:38", "url": "https://files.pythonhosted.org/packages/52/0d/bbdead5857b5ad7d1b072a693af6c075beef3fd5fc74c553e6e92e807b28/wikitrans-1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e0f17da982d8336868add46e69e080f5", "sha256": "fd5c8b28ae8292901aaf3c71df1bbe31e040f2909fb497e8116b8e7663d9f6c3" }, "downloads": -1, "filename": "wikitrans-1.3.tar.gz", "has_sig": false, "md5_digest": "e0f17da982d8336868add46e69e080f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68204, "upload_time": "2018-09-01T19:32:38", "url": "https://files.pythonhosted.org/packages/52/0d/bbdead5857b5ad7d1b072a693af6c075beef3fd5fc74c553e6e92e807b28/wikitrans-1.3.tar.gz" } ] }