{
"info": {
"author": "Erin O'Connell",
"author_email": "erinocon5@gmail.com",
"bugtrack_url": null,
"classifiers": [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython"
],
"description": "\nRequests-XML: XML Parsing for Humans\n====================================\n\n.. image:: https://travis-ci.org/erinxocon/requests-xml.svg?branch=master\n :target: https://travis-ci.org/erinxocon/requests-xml\n.. image:: https://img.shields.io/pypi/v/requests-xml.svg?maxAge=2592000\n :target: https://pypi.python.org/pypi/requests-xml/\n.. image:: https://img.shields.io/pypi/l/requests-xml.svg?maxAge=2592000\n :target: https://opensource.org/licenses/MIT\n\nThis library intends to make parsing XML as\nsimple and intuitive as possible. **Requests-XML** is related\nto the amazing `Requests-HTML `_\nand delivers the same quality of user experience \u2014 with support for our beloved XML documents.\n\nWhen using this library you automatically get:\n\n- *XPath Selectors*, for the *brave* at heart.\n- *Simple Search/Find* for the *faint* at heart.\n- XML to JSON conversion thanks to `xmljson `_.\n- Mocked user-agent (like a real web browser).\n- Connection\u2013pooling and cookie persistence.\n- The Requests experience you know and love, with magical XML parsing abilities.\n\n\nInstallation\n============\n\n.. code-block:: shell\n\n $ pipenv install requests-xml\n \u2728\ud83c\udf70\u2728\n\nOnly **Python 3.6** is supported.\n\n\nTutorial & Usage\n================\n\nMake a GET request to `nasa.gov `_, using `Requests `_:\n\n.. code-block:: pycon\n\n >>> from requests_xml import XMLSession\n >>> session = XMLSession()\n\n >>> r = session.get('https://www.nasa.gov/rss/dyn/lg_image_of_the_day.rss')\n\nGrab a list of all links on the page, as\u2013is (this only works for RSS feeds, or other feeds that happen to have `link` elements):\n\n.. code-block:: pycon\n\n >>> r.xml.links\n ['http://www.nasa.gov/image-feature/from-the-earth-moon-and-beyond', 'http://www.nasa.gov/image-feature/jpl/pia21974/jupiter-s-colorful-cloud-belts', 'http://www.nasa.gov/', 'http://www.nasa.gov/image-feature/portrait-of-the-expedition-54-crew-on-the-space-station', ...]\n\n\nXPath is the main supported way to query an element (`learn more `_):\n\n.. code-block:: pycon\n\n >>> item = r.xml.xpath('//item', first=True)\n \n\nGrab an element's text contents:\n\n.. code-block:: pycon\n\n >>> print(item.text)\n The Beauty of Light\n http://www.nasa.gov/image-feature/the-beauty-of-light\n The Soyuz MS-08 rocket is launched with Soyuz Commander Oleg Artemyev of Roscosmos and astronauts Ricky Arnold and Drew Feustel of NASA, March 21, 2018, to join the crew of the Space Station.\n http://www.nasa.gov/image-feature/the-beauty-of-light\n Wed, 21 Mar 2018 14:12 EDT\n NASA Image of the Day\n\nIntrospect an element's attributes (`learn more `_):\n\n.. code-block:: pycon\n\n >>> rss = r.xml.xpath('//rss', first=True)\n >>> rss.attrs\n {'version': '2.0', '{http://www.w3.org/XML/1998/namespace}base': 'http://www.nasa.gov/'}\n\nRender out an element's XML (note: namespaces will be applied to sub elements when grabbed):\n\n.. code-block:: pycon\n\n >>> item.xml\n 'The Beauty of Light\\n http://www.nasa.gov/image-feature/the-beauty-of-light\\n The Soyuz MS-08 rocket is launched with Soyuz Commander Oleg Artemyev of Roscosmos and astronauts Ricky Arnold and Drew Feustel of NASA, March 21, 2018, to join the crew of the Space Station.\\n \\n http://www.nasa.gov/image-feature/the-beauty-of-light\\n Wed, 21 Mar 2018 14:12 EDT\\n NASA Image of the Day\\n'\n\n\nSelect an element list within an element:\n\n.. code-block:: pycon\n\n >>> item.xpath('//enclosure')[0].attrs['url']\n 'http://www.nasa.gov/sites/default/files/thumbnails/image/nhq201803210005.jpg'\n\nSearch for links within an element:\n\n.. code-block:: pycon\n\n >>> item.links\n ['http://www.nasa.gov/image-feature/the-beauty-of-light']\n\n\nSearch for text on the page. This is useful if you wish to search out things between specific tags without using XPath:\n\n.. code-block:: pycon\n\n >>> r.xml.search('{})\n \n\n\nUsing PyQuery we can use CSS selectors to easily grab an element, with a simple syntax for ensuring the element\ncontains certain text. This can be used as another easy way to grab an element without an XPath:\n\n.. code-block:: pycon\n\n >>> light_title = r.xml.find('title', containing='The Beauty of Light')\n []\n\n >>> light_title[0].text\n 'The Beauty of Light'\n\nNote: XPath is preferred as it can allow you to get very specific with your element selection. Find is intended to be\nan easy way of grabbing all elements of a certain name. Find does however accept CSS selectors, and if you can get those\nto work with straight XML, go for it!\n\nJSON Support\n============\n\nUsing the great `xmljson `_ package, we convert the whole\nXML document into a JSON representation. There are six different conversion convetions available.\nSee the `about `_ for what they are. The default is ``badgerfish``.\nIf you wish to use a different conversion convention, pass in a string with the name of the convetion to the\n``.json()`` method.\n\n\nUsing without Requests\n======================\n\nYou can also use this library without Requests:\n\n.. code-block:: pycon\n\n >>> from requests_xml import XML\n >>> doc = \"\"\"\n \n \n \n \n \n \n \n \n \"\"\"\n\n >>> xml = XML(xml=doc)\n >>> xml.json()\n {\n \"employees\": [{\n \"person\": {\n \"name\": {\n \"@value\": \"Alice\"\n }\n }\n }, {\n \"person\": {\n \"name\": {\n \"@value\": \"Bob\"\n }\n }\n }]\n }\n\nLicense\n=======\nMIT\n\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/erinxocon/requests-xml",
"keywords": "",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "requests-xml",
"package_url": "https://pypi.org/project/requests-xml/",
"platform": "",
"project_url": "https://pypi.org/project/requests-xml/",
"project_urls": {
"Homepage": "https://github.com/erinxocon/requests-xml"
},
"release_url": "https://pypi.org/project/requests-xml/0.2.3/",
"requires_dist": [
"requests",
"pyquery",
"fake-useragent",
"parse",
"w3lib",
"xmljson"
],
"requires_python": ">=3.6.0",
"summary": "XML Parsing for humans.",
"version": "0.2.3"
},
"last_serial": 3702052,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "3f9a671b0726f2c57bc6a18045f2f64f",
"sha256": "8979d8156a4791f98b72dad96a260e0a437a2973210ac8ad7bb0437f882e863a"
},
"downloads": -1,
"filename": "requests_xml-0.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "3f9a671b0726f2c57bc6a18045f2f64f",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 6826,
"upload_time": "2018-03-20T16:59:19",
"url": "https://files.pythonhosted.org/packages/02/d6/5c691c147d305a9601b7996781eb7e5c5716a17138ef5d591ca59e3f4974/requests_xml-0.1.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "fcf6261c872bac587b7692eaabd98151",
"sha256": "67b61d223483d0d7c8c1b1ffddf03fab08b9ad8f27aec7ea7cbda60a0403b14d"
},
"downloads": -1,
"filename": "requests-xml-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "fcf6261c872bac587b7692eaabd98151",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 6413,
"upload_time": "2018-03-20T16:59:20",
"url": "https://files.pythonhosted.org/packages/58/6f/7a838203959c5974ed00f1990ed025a795a0ab2a529642fa461c382e467d/requests-xml-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "5d08b9952e4fdd9095e7e456d939529a",
"sha256": "99d2e35da0d8fb2839ccc0fa3406fe5798c6a4ebbf6145d32a1facae825451b4"
},
"downloads": -1,
"filename": "requests_xml-0.1.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "5d08b9952e4fdd9095e7e456d939529a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 6843,
"upload_time": "2018-03-20T22:37:23",
"url": "https://files.pythonhosted.org/packages/b1/45/53545cca509ca9d6e93a22f2fc7ce3931a76f417ef569b147f57ce65f6e6/requests_xml-0.1.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "66e30e2331ac2a784d2860483f319edf",
"sha256": "0eb3f69cd699f56431fadd22a62572d87cb9cc3ecda1f2da2e06c5f640c38102"
},
"downloads": -1,
"filename": "requests-xml-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "66e30e2331ac2a784d2860483f319edf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 6422,
"upload_time": "2018-03-20T22:37:25",
"url": "https://files.pythonhosted.org/packages/9d/2f/1d206550b0e6e8ffc3328f504ed6a305b6f1c52a6cfeda8116e9cf503ee9/requests-xml-0.1.1.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "028dce0f3d594df299e527883379b5c7",
"sha256": "d2f6ad7db6168def9325bd871ff3a10cc371db6316fca6b1c6d75b23ea53cbc9"
},
"downloads": -1,
"filename": "requests_xml-0.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "028dce0f3d594df299e527883379b5c7",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 10518,
"upload_time": "2018-03-22T01:17:14",
"url": "https://files.pythonhosted.org/packages/99/96/940b5d772363a0a3b417dcf408cdb4cd0e1948ddb57827d536b2e5d2898c/requests_xml-0.2.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b9a8a5264da0f4fd1afe696b7de8e2e0",
"sha256": "a83c374f52ebbb267d05aff3667acf79890b17c64242dba5b382978fb984c047"
},
"downloads": -1,
"filename": "requests-xml-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b9a8a5264da0f4fd1afe696b7de8e2e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 9026,
"upload_time": "2018-03-22T01:17:16",
"url": "https://files.pythonhosted.org/packages/41/44/16dac31104b7591c3a6ec6b3418ee32fd92000657a7e2ed8338a5198af41/requests-xml-0.2.0.tar.gz"
}
],
"0.2.1": [
{
"comment_text": "",
"digests": {
"md5": "db299a539aa421390c62bfeafd8e3fcf",
"sha256": "5bfb403163e56817009598545a354f6390755f115bb36174d84d349e1a5ed60a"
},
"downloads": -1,
"filename": "requests_xml-0.2.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "db299a539aa421390c62bfeafd8e3fcf",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 10634,
"upload_time": "2018-03-22T02:18:52",
"url": "https://files.pythonhosted.org/packages/c1/af/dfafa09b1a50b6b45882a51351425f503ca9c4a034ed14c37ded3d7a4ec6/requests_xml-0.2.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "bcf61b607c9db34b75778af922a4e30d",
"sha256": "069fa65296593db7d60ba4f33906c8cf8d99c1e918b4e358090ea2407c825d08"
},
"downloads": -1,
"filename": "requests-xml-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "bcf61b607c9db34b75778af922a4e30d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 9100,
"upload_time": "2018-03-22T02:18:53",
"url": "https://files.pythonhosted.org/packages/d5/2f/c46ba78274b74dcf21f1747ef3a53fbffab6e830b5e2846399dd6f18c373/requests-xml-0.2.1.tar.gz"
}
],
"0.2.2": [
{
"comment_text": "",
"digests": {
"md5": "ecadba9e0e8b7c12c33b672038f25211",
"sha256": "1b43f46d54da2176eafaa1a50f856b56056031faae05cfe0d7c32ba92bb95e2b"
},
"downloads": -1,
"filename": "requests_xml-0.2.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ecadba9e0e8b7c12c33b672038f25211",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 11495,
"upload_time": "2018-03-22T13:46:18",
"url": "https://files.pythonhosted.org/packages/4d/7a/50b0eb24dbcf14d073848be58d56d404edd5c91a53ec542bc2d44b1eaa53/requests_xml-0.2.2-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "c3743c9d4eb0a53e349bfff21d1c19a2",
"sha256": "91b4068fbfcf6dbcec24cd7a19d655339a20cb8512d3984e677f11190e323dd3"
},
"downloads": -1,
"filename": "requests-xml-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "c3743c9d4eb0a53e349bfff21d1c19a2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 9832,
"upload_time": "2018-03-22T13:46:19",
"url": "https://files.pythonhosted.org/packages/93/23/f6935b9776ce32712edc037c3d9fac552d076748ec0e32db44414d91ecdf/requests-xml-0.2.2.tar.gz"
}
],
"0.2.3": [
{
"comment_text": "",
"digests": {
"md5": "16f062423325f94d4a00b5e13bed611b",
"sha256": "a428482b0b08d76cbba0a6e2136ae0ff8f6ffe22c3a60f03e3a6983fbb27a79c"
},
"downloads": -1,
"filename": "requests_xml-0.2.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "16f062423325f94d4a00b5e13bed611b",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 11515,
"upload_time": "2018-03-24T18:54:35",
"url": "https://files.pythonhosted.org/packages/3e/39/2229bdb377549b44794e7947ad1dab01da6033d435bc952a97215db5f581/requests_xml-0.2.3-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "8e3ac85e3552f1d2b04e6b431248ae02",
"sha256": "ba2e8d508594561df3b7fada50d2d36cfda00ee3307f8d8ee406ac92b2d9c5c8"
},
"downloads": -1,
"filename": "requests-xml-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "8e3ac85e3552f1d2b04e6b431248ae02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 9874,
"upload_time": "2018-03-24T18:54:36",
"url": "https://files.pythonhosted.org/packages/e4/6f/50c80681e25473ebf4750d7a8c8781afd147f9820faae3430487bbce5bda/requests-xml-0.2.3.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "16f062423325f94d4a00b5e13bed611b",
"sha256": "a428482b0b08d76cbba0a6e2136ae0ff8f6ffe22c3a60f03e3a6983fbb27a79c"
},
"downloads": -1,
"filename": "requests_xml-0.2.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "16f062423325f94d4a00b5e13bed611b",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 11515,
"upload_time": "2018-03-24T18:54:35",
"url": "https://files.pythonhosted.org/packages/3e/39/2229bdb377549b44794e7947ad1dab01da6033d435bc952a97215db5f581/requests_xml-0.2.3-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "8e3ac85e3552f1d2b04e6b431248ae02",
"sha256": "ba2e8d508594561df3b7fada50d2d36cfda00ee3307f8d8ee406ac92b2d9c5c8"
},
"downloads": -1,
"filename": "requests-xml-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "8e3ac85e3552f1d2b04e6b431248ae02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 9874,
"upload_time": "2018-03-24T18:54:36",
"url": "https://files.pythonhosted.org/packages/e4/6f/50c80681e25473ebf4750d7a8c8781afd147f9820faae3430487bbce5bda/requests-xml-0.2.3.tar.gz"
}
]
}