{ "info": { "author": "jschulman@juniper.net", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# LXML Extension Library for IP address\n\nThis library contains LXML extension functions that wrap the Python ipaddress library.\n\nWith this library in place, you can do XPath expressions to find IP items within our XML data. For\nexample:\n\n````python\nfrom lxml import etree\nfrom lxml_xpath_ipaddress import ip_ns\n\n# given \"config\" is an LXML XML structure, you can run the XPath to find all IPv4 network items:\n\nconfig = etree.parse('tests/config.xml')\n\n\nitems = config.xpath('//*[ip:ip4-net(.)', namespaces=ip_ns)\n\nprint(items[0].text)\n# >>> 10.10.0.0/16\n\n# Find all items that are in either the 172.18/16 or 101.10.201/24 subnets\n\nitems = config.xpath('//*[ip:in-subnet(., \"172.18.0.0/16\") or ip:in-subnet(., \"10.10.201.0/24\")]',\n namespaces=ip_ns)\n\nprint(items[0].text)\n# >>> 172.18.1.1\n````\n\n# Install\n\n```bash\n$ pip install lxml-xpath-ipaddress\n```\n\n# LXML Extension Functions\n\n## Either IPv4 or IPv6\n\n * ip-any(value)\n * ip-net(value)\n * ip-host(value)\n\n## IPv4\n\n * ip4-any(value)\n * ip4-net(value)\n * ip4-host(value)\n\n## IPv6\n\n * ip6-any(value)\n * ip6-net(value)\n * ip6-host(value)\n\n## Subnet Checking\n\n * in-subnet(value, subnet-string)\n\n# Python Functions\n\nThe library contains these functions as general purpose functions as well, \nso that they can be used in other applications. See the module doc-strings for use. \n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jeremyschulman/junospyez-ossh-server", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lxml-xpath-ipaddress", "package_url": "https://pypi.org/project/lxml-xpath-ipaddress/", "platform": "", "project_url": "https://pypi.org/project/lxml-xpath-ipaddress/", "project_urls": { "Homepage": "https://github.com/jeremyschulman/junospyez-ossh-server" }, "release_url": "https://pypi.org/project/lxml-xpath-ipaddress/0.2.0/", "requires_dist": [ "lxml" ], "requires_python": "", "summary": "LXML xpath extension library for ipaddress", "version": "0.2.0" }, "last_serial": 4450380, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "5ddec8f6cc83922124f6a708769469c4", "sha256": "181445ce60bf6f9eb8bc1594d287577122af60bc31f7c7c59d7bc3240347ea21" }, "downloads": -1, "filename": "lxml_xpath_ipaddress-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5ddec8f6cc83922124f6a708769469c4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6688, "upload_time": "2018-11-04T19:11:54", "url": "https://files.pythonhosted.org/packages/34/30/ab0c1dc10730c4bb6dadfbd7a52309d932f73195e7259c0c4656d91700d1/lxml_xpath_ipaddress-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37eb270c828cd227fed2a292c52fb526", "sha256": "0db34d6d4277c243cf9cf750434b7d30f3c3dfff53b82f4f2f849b9d00a77be8" }, "downloads": -1, "filename": "lxml-xpath-ipaddress-0.2.0.tar.gz", "has_sig": false, "md5_digest": "37eb270c828cd227fed2a292c52fb526", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3642, "upload_time": "2018-11-04T19:11:55", "url": "https://files.pythonhosted.org/packages/d5/38/95de062ae456792bd8ece586b1d648f305167a0705320ed53cae631522d1/lxml-xpath-ipaddress-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5ddec8f6cc83922124f6a708769469c4", "sha256": "181445ce60bf6f9eb8bc1594d287577122af60bc31f7c7c59d7bc3240347ea21" }, "downloads": -1, "filename": "lxml_xpath_ipaddress-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5ddec8f6cc83922124f6a708769469c4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6688, "upload_time": "2018-11-04T19:11:54", "url": "https://files.pythonhosted.org/packages/34/30/ab0c1dc10730c4bb6dadfbd7a52309d932f73195e7259c0c4656d91700d1/lxml_xpath_ipaddress-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37eb270c828cd227fed2a292c52fb526", "sha256": "0db34d6d4277c243cf9cf750434b7d30f3c3dfff53b82f4f2f849b9d00a77be8" }, "downloads": -1, "filename": "lxml-xpath-ipaddress-0.2.0.tar.gz", "has_sig": false, "md5_digest": "37eb270c828cd227fed2a292c52fb526", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3642, "upload_time": "2018-11-04T19:11:55", "url": "https://files.pythonhosted.org/packages/d5/38/95de062ae456792bd8ece586b1d648f305167a0705320ed53cae631522d1/lxml-xpath-ipaddress-0.2.0.tar.gz" } ] }