{ "info": { "author": "John-Paul Jorissen", "author_email": "jjorissen52@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: Microsoft :: Windows :: Windows 10", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "\n.. code:: ipython3\n\n from xmlmanip import XMLSchema, SearchableList\n\n.. code:: ipython3\n\n string = \"\"\"\n \n \n Belgian Waffles\n $5.95\n \n Two of our famous Belgian Waffles with plenty of real maple syrup\n \n 650\n \n \n Strawberry Belgian Waffles\n $7.95\n \n Light Belgian waffles covered with strawberries and whipped cream\n \n 900\n \n \n Berry-Berry Belgian Waffles\n $8.95\n \n Belgian waffles covered with assorted fresh berries and whipped cream\n \n 900\n \n \n French Toast\n $4.50\n \n Thick slices made from our homemade sourdough bread\n \n 600\n \n \n Homestyle Breakfast\n $6.95\n \n Two eggs, bacon or sausage, toast, and our ever-popular hash browns\n \n 950\n \n \n \"\"\"\n\nYou can import your XML string to convert it to a dict. (dict conversion\nhandled by https://github.com/martinblech/xmltodict).\n\n.. code:: ipython3\n\n schema = XMLSchema(string)\n schema\n\n\n\n\n.. parsed-literal::\n\n XMLSchema([('breakfast_menu',\n OrderedDict([('food',\n [OrderedDict([('@tag', 'waffles'),\n ('name', 'Belgian Waffles'),\n ('price', '$5.95'),\n ('description',\n 'Two of our famous Belgian Waffles with plenty of real maple syrup'),\n ('calories', '650')]),\n OrderedDict([('@tag', 'waffles'),\n ('name', 'Strawberry Belgian Waffles'),\n ('price', '$7.95'),\n ('description',\n 'Light Belgian waffles covered with strawberries and whipped cream'),\n ('calories', '900')]),\n OrderedDict([('@tag', 'waffles'),\n ('name',\n 'Berry-Berry Belgian Waffles'),\n ('price', '$8.95'),\n ('description',\n 'Belgian waffles covered with assorted fresh berries and whipped cream'),\n ('calories', '900')]),\n OrderedDict([('@tag', 'toast'),\n ('name', 'French Toast'),\n ('price', '$4.50'),\n ('description',\n 'Thick slices made from our homemade sourdough bread'),\n ('calories', '600')]),\n OrderedDict([('@tag', 'classic'),\n ('name', 'Homestyle Breakfast'),\n ('price', '$6.95'),\n ('description',\n 'Two eggs, bacon or sausage, toast, and our ever-popular hash browns'),\n ('calories', '950')])])]))])\n\n\n\nUse .search() to search for data of interest.\n\n.. code:: ipython3\n\n schema.search(name=\"Homestyle Breakfast\")\n\n\n\n\n.. parsed-literal::\n\n [SchemaInnerDict([('@tag', 'classic'),\n ('name', 'Homestyle Breakfast'),\n ('price', '$6.95'),\n ('description',\n 'Two eggs, bacon or sausage, toast, and our ever-popular hash browns'),\n ('calories', '950')])]\n\n\n\nThe ``SearchAbleList`` class will also allow you to easily search\nthrough lists of dicts.\n\n.. code:: ipython3\n\n example_list = [{\"thing\": 1, \"other_thing\": 2}, {\"thing\": 2, \"other_thing\": 2}]\n searchable_list = SearchableList(example_list)\n print(searchable_list.search(thing__ne=2)) # thing != 2\n print(searchable_list.search(other_thing=2))\n\n\n.. parsed-literal::\n\n [{'thing': 1, 'other_thing': 2}]\n [{'thing': 1, 'other_thing': 2}, {'thing': 2, 'other_thing': 2}]\n\n\nUse .locate() if you are interested in the \"path\" to your data of\ninterest and .retrieve() to get an object from its \"path.\"\n\n.. code:: ipython3\n\n schema.locate(name=\"Homestyle Breakfast\")\n\n\n\n\n.. parsed-literal::\n\n ['__breakfast_menu__food__4__name']\n\n\n\n.. code:: ipython3\n\n schema.retrieve('__breakfast_menu__food__4__name')\n\n\n\n\n.. parsed-literal::\n\n 'Homestyle Breakfast'\n\n\n\n.. code:: ipython3\n\n schema.retrieve('__breakfast_menu__food__4')\n\n\n\n\n.. parsed-literal::\n\n SchemaInnerDict([('@tag', 'classic'),\n ('name', 'Homestyle Breakfast'),\n ('price', '$6.95'),\n ('description',\n 'Two eggs, bacon or sausage, toast, and our ever-popular hash browns'),\n ('calories', '950')])\n\n\n\nYou have access to all of the standard comparison methods.\n\n.. code:: ipython3\n\n paths = schema.locate(name__contains=\"Waffles\")\n paths\n\n\n\n\n.. parsed-literal::\n\n ['__breakfast_menu__food__0__name',\n '__breakfast_menu__food__1__name',\n '__breakfast_menu__food__2__name']\n\n\n\n.. code:: ipython3\n\n schema.search(name__contains=\"Waffles\")\n\n\n\n\n.. parsed-literal::\n\n [SchemaInnerDict([('@tag', 'waffles'),\n ('name', 'Belgian Waffles'),\n ('price', '$5.95'),\n ('description',\n 'Two of our famous Belgian Waffles with plenty of real maple syrup'),\n ('calories', '650')]),\n SchemaInnerDict([('@tag', 'waffles'),\n ('name', 'Berry-Berry Belgian Waffles'),\n ('price', '$8.95'),\n ('description',\n 'Belgian waffles covered with assorted fresh berries and whipped cream'),\n ('calories', '900')]),\n SchemaInnerDict([('@tag', 'waffles'),\n ('name', 'Strawberry Belgian Waffles'),\n ('price', '$7.95'),\n ('description',\n 'Light Belgian waffles covered with strawberries and whipped cream'),\n ('calories', '900')])]\n\n\n\n.. code:: ipython3\n\n schema.search(calories__lt=\"700\")\n\n\n\n\n.. parsed-literal::\n\n [SchemaInnerDict([('@tag', 'toast'),\n ('name', 'French Toast'),\n ('price', '$4.50'),\n ('description',\n 'Thick slices made from our homemade sourdough bread'),\n ('calories', '600')]),\n SchemaInnerDict([('@tag', 'waffles'),\n ('name', 'Belgian Waffles'),\n ('price', '$5.95'),\n ('description',\n 'Two of our famous Belgian Waffles with plenty of real maple syrup'),\n ('calories', '650')])]\n\n\n\nWarning, all types are compared as strings, which may have undesirable results.\n===============================================================================\n\n.. code:: ipython3\n\n schema.search(calories__lt=\"700\") == schema.search(calories__lt=\"70\") \n\n\n\n\n.. parsed-literal::\n\n True\n\n\n\nSome attributes cannot be accessed via keyword arguements,\nunfortunately.\n\n.. code:: ipython3\n\n schema.search(@tag__ne=\"waffles\")\n\n\n::\n\n\n File \"\", line 1\n schema.search(@tag__ne=\"waffles\")\n ^\n SyntaxError: invalid syntax\n\n\n\nYou will need to pass the desired attribute and comparison method as\nstrings in this case.\n\n.. code:: ipython3\n\n schema.search('@tag', 'waffles') # default comparison is __eq__\n\n\n\n\n.. parsed-literal::\n\n [SchemaInnerDict([('@tag', 'waffles'),\n ('name', 'Belgian Waffles'),\n ('price', '$5.95'),\n ('description',\n 'Two of our famous Belgian Waffles with plenty of real maple syrup'),\n ('calories', '650')]),\n SchemaInnerDict([('@tag', 'waffles'),\n ('name', 'Strawberry Belgian Waffles'),\n ('price', '$7.95'),\n ('description',\n 'Light Belgian waffles covered with strawberries and whipped cream'),\n ('calories', '900')]),\n SchemaInnerDict([('@tag', 'waffles'),\n ('name', 'Berry-Berry Belgian Waffles'),\n ('price', '$8.95'),\n ('description',\n 'Belgian waffles covered with assorted fresh berries and whipped cream'),\n ('calories', '900')])]\n\n\n\n.. code:: ipython3\n\n schema.search('@tag', 'waffles', comparison='ne')\n\n\n\n\n.. parsed-literal::\n\n [SchemaInnerDict([('@tag', 'classic'),\n ('name', 'Homestyle Breakfast'),\n ('price', '$6.95'),\n ('description',\n 'Two eggs, bacon or sausage, toast, and our ever-popular hash browns'),\n ('calories', '950')]),\n SchemaInnerDict([('@tag', 'toast'),\n ('name', 'French Toast'),\n ('price', '$4.50'),\n ('description',\n 'Thick slices made from our homemade sourdough bread'),\n ('calories', '600')])]\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jjorissen52/xmlmanip", "keywords": "XML document parse search", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "xmlmanip", "package_url": "https://pypi.org/project/xmlmanip/", "platform": "", "project_url": "https://pypi.org/project/xmlmanip/", "project_urls": { "Homepage": "https://github.com/jjorissen52/xmlmanip" }, "release_url": "https://pypi.org/project/xmlmanip/1.1.8.dev0/", "requires_dist": null, "requires_python": "", "summary": "Convert XML documents to dict and easily search for and retrieve the data they contain.", "version": "1.1.8.dev0" }, "last_serial": 3640998, "releases": { "1.0.0.dev0": [ { "comment_text": "", "digests": { "md5": "204b07ecbc3824b02c0e63fa1c62b892", "sha256": "884aea20171d3fbd03b248cd129232e32fb852eb1bdaeac63a61f5dd08b46d8a" }, "downloads": -1, "filename": "xmlmanip-1.0.0.dev0.tar.gz", "has_sig": false, "md5_digest": "204b07ecbc3824b02c0e63fa1c62b892", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5197, "upload_time": "2017-08-08T16:00:02", "url": "https://files.pythonhosted.org/packages/05/f0/7942ba10bc32aa81815fe260e8bcc84c8960bf7f407ac03fcb430d9217f9/xmlmanip-1.0.0.dev0.tar.gz" } ], "1.0.1.dev0": [ { "comment_text": "", "digests": { "md5": "a7bd9aa49a8687f637db461344e9b50e", "sha256": "a971da834ee1302b0d29ebf8fc6f45b25660492b6a051e6ae63409ed0ae29248" }, "downloads": -1, "filename": "xmlmanip-1.0.1.dev0.tar.gz", "has_sig": false, "md5_digest": "a7bd9aa49a8687f637db461344e9b50e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5187, "upload_time": "2017-08-08T16:01:55", "url": "https://files.pythonhosted.org/packages/2c/05/670c02d0b92e86b4f1b12bb192552947c3e07afd11f3cbb067534bb085f5/xmlmanip-1.0.1.dev0.tar.gz" } ], "1.1.0.dev0": [ { "comment_text": "", "digests": { "md5": "f02308ff010b5e26df7220535ae822f4", "sha256": "e0ae75901c50a6ee9ab64f38f8b0b51f1394771e660388d0b9933ee89e2a46b0" }, "downloads": -1, "filename": "xmlmanip-1.1.0.dev0.tar.gz", "has_sig": false, "md5_digest": "f02308ff010b5e26df7220535ae822f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6197, "upload_time": "2017-09-18T16:43:54", "url": "https://files.pythonhosted.org/packages/f0/17/91f8dcb928c5a17cb3fd940c513ca0acb01bbc06beabe451402c7736cb75/xmlmanip-1.1.0.dev0.tar.gz" } ], "1.1.1.dev0": [ { "comment_text": "", "digests": { "md5": "1490fdbf97ea45c9c4fe23887f8c9d57", "sha256": "81fa5f81880f7bd9b0fd7464d14a3d663c06f5999c66e6e1bb5a4a44da775c99" }, "downloads": -1, "filename": "xmlmanip-1.1.1.dev0.tar.gz", "has_sig": false, "md5_digest": "1490fdbf97ea45c9c4fe23887f8c9d57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6718, "upload_time": "2017-09-19T17:15:57", "url": "https://files.pythonhosted.org/packages/24/2a/5169b5109d3adb0db4b9f5b97d032a489716c6356a9e17f2c23ca4e93726/xmlmanip-1.1.1.dev0.tar.gz" } ], "1.1.2.dev0": [ { "comment_text": "", "digests": { "md5": "60f7d2ad2c4fc7fe8008a58af2da3ba5", "sha256": "07bc2a69e898adeb1f0ecef5e7c3be573ed86eab43f9e2ce03b64354c2b44533" }, "downloads": -1, "filename": "xmlmanip-1.1.2.dev0.tar.gz", "has_sig": false, "md5_digest": "60f7d2ad2c4fc7fe8008a58af2da3ba5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6719, "upload_time": "2017-09-19T17:20:42", "url": "https://files.pythonhosted.org/packages/37/41/4eb0b7f7d63c5ce32a78e38b81a277e1905324959d208bc17196e225d61f/xmlmanip-1.1.2.dev0.tar.gz" } ], "1.1.3.dev0": [ { "comment_text": "", "digests": { "md5": "e7ad29c2fd471cb77cd907c504c862b2", "sha256": "0035de065a6372eb22e0864c9355525745d8935563932a7cd27883c2c50465b7" }, "downloads": -1, "filename": "xmlmanip-1.1.3.dev0.tar.gz", "has_sig": false, "md5_digest": "e7ad29c2fd471cb77cd907c504c862b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6733, "upload_time": "2017-09-19T17:36:39", "url": "https://files.pythonhosted.org/packages/fd/2e/e224f13158fc98482f6077bf28cfb044d00a1c5601431cb88a454329a101/xmlmanip-1.1.3.dev0.tar.gz" } ], "1.1.4.dev0": [ { "comment_text": "", "digests": { "md5": "165539377a6f6da17046df6961b791fe", "sha256": "86fee9775d6f6d012a45838eb24adb79aec45b28bcfc7d6677c517d962d8356f" }, "downloads": -1, "filename": "xmlmanip-1.1.4.dev0.tar.gz", "has_sig": false, "md5_digest": "165539377a6f6da17046df6961b791fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6738, "upload_time": "2017-09-25T17:33:48", "url": "https://files.pythonhosted.org/packages/7b/f8/f43ebee89952a0da6af78991b99a0ac86874eebac52833ce66911fcc4c3b/xmlmanip-1.1.4.dev0.tar.gz" } ], "1.1.5.dev0": [ { "comment_text": "", "digests": { "md5": "4b02cb6a79ee134763fc04617574ca20", "sha256": "dccaa95a63c97c8eec57ed04d8cb8c1910d4b83ec999bd84371b8967f4673e74" }, "downloads": -1, "filename": "xmlmanip-1.1.5.dev0.tar.gz", "has_sig": false, "md5_digest": "4b02cb6a79ee134763fc04617574ca20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6754, "upload_time": "2017-09-25T18:07:35", "url": "https://files.pythonhosted.org/packages/4f/ca/d68632b0db920fbee2cbd9c81f720db4fde720ea9c476a69ebfced96c9c9/xmlmanip-1.1.5.dev0.tar.gz" } ], "1.1.6.dev0": [ { "comment_text": "", "digests": { "md5": "12a0411a720314d259e5ac0446279cfa", "sha256": "fa2917599d852bc0207cf638f886063113cd23dc258d02b0d148d60ea254cafb" }, "downloads": -1, "filename": "xmlmanip-1.1.6.dev0.tar.gz", "has_sig": false, "md5_digest": "12a0411a720314d259e5ac0446279cfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7147, "upload_time": "2017-10-24T20:39:58", "url": "https://files.pythonhosted.org/packages/16/e6/d2205b517fb541c5cd5d4fd4d7453a3ddfde636f1e51557e7d4a05c5ef82/xmlmanip-1.1.6.dev0.tar.gz" } ], "1.1.7.dev0": [ { "comment_text": "", "digests": { "md5": "d1c1f5634e3de974a363e42b77f14f22", "sha256": "ff0d676716d91b7e9380242ee16a45c3e9ebdbdf6929d2de3c90e4b4e3781450" }, "downloads": -1, "filename": "xmlmanip-1.1.7.dev0.tar.gz", "has_sig": false, "md5_digest": "d1c1f5634e3de974a363e42b77f14f22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7871, "upload_time": "2017-10-27T17:33:29", "url": "https://files.pythonhosted.org/packages/95/5b/717885197112f1ebdf77882208e75ba6aa1721f5b87fb81f6ee9714c6095/xmlmanip-1.1.7.dev0.tar.gz" } ], "1.1.8.dev0": [ { "comment_text": "", "digests": { "md5": "ed279c1acee47dda5e439b4c132b715f", "sha256": "4cb41572d3076dfbc20b14210de3f875fb1abe26cb49dfbde7f0c41c4ecebe6d" }, "downloads": -1, "filename": "xmlmanip-1.1.8.dev0.tar.gz", "has_sig": false, "md5_digest": "ed279c1acee47dda5e439b4c132b715f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9211, "upload_time": "2018-03-05T16:15:56", "url": "https://files.pythonhosted.org/packages/7d/13/e86bd7acf9403552d2f9e4cc817bca06f0e87377ee61313e55b427d2a7d1/xmlmanip-1.1.8.dev0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed279c1acee47dda5e439b4c132b715f", "sha256": "4cb41572d3076dfbc20b14210de3f875fb1abe26cb49dfbde7f0c41c4ecebe6d" }, "downloads": -1, "filename": "xmlmanip-1.1.8.dev0.tar.gz", "has_sig": false, "md5_digest": "ed279c1acee47dda5e439b4c132b715f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9211, "upload_time": "2018-03-05T16:15:56", "url": "https://files.pythonhosted.org/packages/7d/13/e86bd7acf9403552d2f9e4cc817bca06f0e87377ee61313e55b427d2a7d1/xmlmanip-1.1.8.dev0.tar.gz" } ] }