{ "info": { "author": "Antonin Delpeuch", "author_email": "first_name@last_name.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Text Processing :: Markup" ], "description": "wikiciteparser\n==============\n\nThis Python library wraps Wikipedia's citation processing code (written\nin Lua) to parse citation templates. For instance, there are many\ndifferent ways to specify the authors of a citation: this codes maps all\nof them to the same representation.\n\nDistributed under the MIT license.\n\nDependencies: lupa, mwparserfromhell\n\nExample\n-------\n\nLet's parse the reference section of `this\narticle `__::\n\n import mwparserfromhell\n import wikiciteparser\n\n mwtext = \"\"\"\n ===Articles===\n * {{Citation | last1=Lambek | first1=Joachim | author1-link=Joachim Lambek | last2=Moser | first2=L. | title=Inverse and Complementary Sequences of Natural Numbers| doi=10.2307/2308078 | mr=0062777 | journal=[[American Mathematical Monthly|The American Mathematical Monthly]] | issn=0002-9890 | volume=61 | issue=7 | pages=454\u2013458 | year=1954 | jstor=2308078 | publisher=The American Mathematical Monthly, Vol. 61, No. 7}}\n * {{Citation | last1=Lambek | first1=J. | author1-link=Joachim Lambek | title=The Mathematics of Sentence Structure | year=1958 | journal=[[American Mathematical Monthly|The American Mathematical Monthly]] | issn=0002-9890 | volume=65 | pages=154\u2013170 | doi=10.2307/2310058 | issue=3 | publisher=The American Mathematical Monthly, Vol. 65, No. 3 | jstor=1480361}}\n *{{Citation | last1=Lambek | first1=Joachim | author1-link=Joachim Lambek | title=Bicommutators of nice injectives | doi=10.1016/0021-8693(72)90034-8 | mr=0301052 | year=1972 | journal=Journal of Algebra | issn=0021-8693 | volume=21 | pages=60\u201373}}\n *{{Citation | last1=Lambek | first1=Joachim | author1-link=Joachim Lambek | title=Localization and completion | doi=10.1016/0022-4049(72)90011-4 | mr=0320047 | year=1972 | journal=Journal of Pure and Applied Algebra | issn=0022-4049 | volume=2 | pages=343\u2013370 | issue=4}}\n *{{Citation | last1=Lambek | first1=Joachim | author1-link=Joachim Lambek | title=A mathematician looks at Latin conjugation | mr=589163 | year=1979 | journal=Theoretical Linguistics | issn=0301-4428 | volume=6 | issue=2 | pages=221\u2013234 | doi=10.1515/thli.1979.6.1-3.221}}\n \"\"\"\n\n wikicode = mwparserfromhell.parse(mwtext)\n for tpl in wikicode.filter_templates():\n parsed = parse_citation_template(tpl)\n print parsed\n\nHere is what you get::\n\n {u'PublisherName': u'The American Mathematical Monthly, Vol. 61, No. 7', u'Title': u'Inverse and Complementary Sequences of Natural Numbers', u'ID_list': {u'DOI': u'10.2307/2308078', u'ISSN': u'0002-9890', u'MR': u'0062777', u'JSTOR': u'2308078'}, u'Periodical': u'The American Mathematical Monthly', u'Authors': [{u'link': u'Joachim Lambek', u'last': u'Lambek', u'first': u'Joachim'}, {u'last': u'Moser', u'first': u'L.'}], u'Date': u'1954', u'Pages': u'454-458'}\n {u'PublisherName': u'The American Mathematical Monthly, Vol. 65, No. 3', u'Title': u'The Mathematics of Sentence Structure', u'ID_list': {u'DOI': u'10.2307/2310058', u'ISSN': u'0002-9890', u'JSTOR': u'1480361'}, u'Periodical': u'The American Mathematical Monthly', u'Authors': [{u'link': u'Joachim Lambek', u'last': u'Lambek', u'first': u'J.'}], u'Date': u'1958', u'Pages': u'154-170'}\n {u'Title': u'Bicommutators of nice injectives', u'ID_list': {u'DOI': u'10.1016/0021-8693(72)90034-8', u'ISSN': u'0021-8693', u'MR': u'0301052'}, u'Periodical': u'Journal of Algebra', u'Authors': [{u'link': u'Joachim Lambek', u'last': u'Lambek', u'first': u'Joachim'}], u'Date': u'1972', u'Pages': u'60-73'}\n {u'Title': u'Localization and completion', u'ID_list': {u'DOI': u'10.1016/0022-4049(72)90011-4', u'ISSN': u'0022-4049', u'MR': u'0320047'}, u'Periodical': u'Journal of Pure and Applied Algebra', u'Authors': [{u'link': u'Joachim Lambek', u'last': u'Lambek', u'first': u'Joachim'}], u'Date': u'1972', u'Pages': u'343-370'}\n {u'Title': u'A mathematician looks at Latin conjugation', u'ID_list': {u'DOI': u'10.1515/thli.1979.6.1-3.221', u'ISSN': u'0301-4428', u'MR': u'589163'}, u'Periodical': u'Theoretical Linguistics', u'Authors': [{u'link': u'Joachim Lambek', u'last': u'Lambek', u'first': u'Joachim'}], u'Date': u'1979', u'Pages': u'221-234'}", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dissemin/wikiciteparser", "keywords": "wikipedia citation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "wikiciteparser", "package_url": "https://pypi.org/project/wikiciteparser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wikiciteparser/", "project_urls": { "Homepage": "https://github.com/dissemin/wikiciteparser" }, "release_url": "https://pypi.org/project/wikiciteparser/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "A parser for wikipedia citation templates", "version": "0.1.1" }, "last_serial": 2002292, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "24e0e1e7329597341f8259e25977f634", "sha256": "a74e93809f2b4ebc1eacc63b94215940f73e912db953a1dc928c00e8efcdb0e1" }, "downloads": -1, "filename": "wikiciteparser-0.1.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "24e0e1e7329597341f8259e25977f634", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9117, "upload_time": "2016-03-11T22:56:41", "url": "https://files.pythonhosted.org/packages/bb/24/0e6257fc86d1a306bf07d6dd1208e4459178c0aca228747594bb998d5319/wikiciteparser-0.1.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "c84c679c21d851598654560ea3ebbd21", "sha256": "8604610547ad02da6ec89061031e619e58e030fe9f24218bd5870193dd437cc5" }, "downloads": -1, "filename": "wikiciteparser-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c84c679c21d851598654560ea3ebbd21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6848, "upload_time": "2016-03-11T22:59:37", "url": "https://files.pythonhosted.org/packages/8d/a1/a75fdfcd894ee35e876fa38fdb6aca6bbed4e6eb00568110cc98cc4d63bb/wikiciteparser-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8670b42d491ba0fbd2dfdbb3c65d7982", "sha256": "715a34ef607addd1ad1710997f41bbc8770f41871fed5d7ad0b72492ce14dd26" }, "downloads": -1, "filename": "wikiciteparser-0.1.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "8670b42d491ba0fbd2dfdbb3c65d7982", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 78221, "upload_time": "2016-03-11T23:10:55", "url": "https://files.pythonhosted.org/packages/3a/8b/11871dab510a471ddf0ed59b888df516d38cbcab0097eaa44438a4ed9ccf/wikiciteparser-0.1.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "ec6d2da7e6fb254f50db373c7f0db3ac", "sha256": "9419c78219d956712091db341ce1b2995fd6bd1dd2005fc4ce6549873e279008" }, "downloads": -1, "filename": "wikiciteparser-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ec6d2da7e6fb254f50db373c7f0db3ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 77226, "upload_time": "2016-03-11T23:11:26", "url": "https://files.pythonhosted.org/packages/e9/68/42bf881302c51d6fb0a6dadd766997144495646d92ac9dd9d2931d195ec1/wikiciteparser-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8670b42d491ba0fbd2dfdbb3c65d7982", "sha256": "715a34ef607addd1ad1710997f41bbc8770f41871fed5d7ad0b72492ce14dd26" }, "downloads": -1, "filename": "wikiciteparser-0.1.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "8670b42d491ba0fbd2dfdbb3c65d7982", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 78221, "upload_time": "2016-03-11T23:10:55", "url": "https://files.pythonhosted.org/packages/3a/8b/11871dab510a471ddf0ed59b888df516d38cbcab0097eaa44438a4ed9ccf/wikiciteparser-0.1.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "ec6d2da7e6fb254f50db373c7f0db3ac", "sha256": "9419c78219d956712091db341ce1b2995fd6bd1dd2005fc4ce6549873e279008" }, "downloads": -1, "filename": "wikiciteparser-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ec6d2da7e6fb254f50db373c7f0db3ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 77226, "upload_time": "2016-03-11T23:11:26", "url": "https://files.pythonhosted.org/packages/e9/68/42bf881302c51d6fb0a6dadd766997144495646d92ac9dd9d2931d195ec1/wikiciteparser-0.1.1.tar.gz" } ] }