{ "info": { "author": "Michael J. Schultz", "author_email": "mjschultz@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Networking" ], "description": "py-radix\n========\n\n.. image:: https://travis-ci.org/mjschultz/py-radix.svg?branch=master\n :target: https://travis-ci.org/mjschultz/py-radix\n\n.. image:: https://coveralls.io/repos/mjschultz/py-radix/badge.png?branch=master\n :target: https://coveralls.io/r/mjschultz/py-radix?branch=master\n\npy-radix implements the radix tree data structure for the storage and\nretrieval of IPv4 and IPv6 network prefixes.\n\nThe radix tree is commonly used for routing table lookups. It efficiently\nstores network prefixes of varying lengths and allows fast lookups of\ncontaining networks.\n\nInstallation\n------------\n\nInstallation is a breeze via pip: ::\n\n pip install py-radix\n\nOr with the standard Python distutils incantation: ::\n\n\tpython setup.py build\n\tpython setup.py install\n\nThe C extension will be built for supported python versions. If you do not\nwant the C extension, set the environment variable ``RADIX_NO_EXT=1``.\n\nTests are in the ``tests/`` directory and can be run with\n``python setup.py nosetests``.\n\nUsage\n-----\n\nA simple example that demonstrates most of the features: ::\n\n\timport radix\n\n\t# Create a new tree\n\trtree = radix.Radix()\n\n\t# Adding a node returns a RadixNode object. You can create\n\t# arbitrary members in its 'data' dict to store your data\n\trnode = rtree.add(\"10.0.0.0/8\")\n\trnode.data[\"blah\"] = \"whatever you want\"\n\n\t# You can specify nodes as CIDR addresses, or networks with\n\t# separate mask lengths. The following three invocations are\n\t# identical:\n\trnode = rtree.add(\"10.0.0.0/16\")\n\trnode = rtree.add(\"10.0.0.0\", 16)\n\trnode = rtree.add(network = \"10.0.0.0\", masklen = 16)\n\n\t# It is also possible to specify nodes using binary packed\n\t# addresses, such as those returned by the socket module\n\t# functions. In this case, the radix module will assume that\n\t# a four-byte address is an IPv4 address and a sixteen-byte\n\t# address is an IPv6 address. For example:\n\tbinary_addr = inet_ntoa(\"172.18.22.0\")\n\trnode = rtree.add(packed = binary_addr, masklen = 23)\n\n\t# Exact search will only return prefixes you have entered\n\t# You can use all of the above ways to specify the address\n\trnode = rtree.search_exact(\"10.0.0.0/8\")\n\t# Get your data back out\n\tprint rnode.data[\"blah\"]\n\t# Use a packed address\n\taddr = socket.inet_ntoa(\"10.0.0.0\")\n\trnode = rtree.search_exact(packed = addr, masklen = 8)\n\n\t# Best-match search will return the longest matching prefix\n\t# that contains the search term (routing-style lookup)\n\trnode = rtree.search_best(\"10.123.45.6\")\n\n\t# Worst-search will return the shortest matching prefix\n\t# that contains the search term (inverse routing-style lookup)\n\trnode = rtree.search_worst(\"10.123.45.6\")\n\n\t# Covered search will return all prefixes inside the given\n\t# search term, as a list (including the search term itself,\n\t# if present in the tree)\n\trnodes = rtree.search_covered(\"10.123.0.0/16\")\n\n\t# There are a couple of implicit members of a RadixNode:\n\tprint rnode.network\t# -> \"10.0.0.0\"\n\tprint rnode.prefix\t# -> \"10.0.0.0/8\"\n\tprint rnode.prefixlen\t# -> 8\n\tprint rnode.family\t# -> socket.AF_INET\n\tprint rnode.packed\t# -> '\\n\\x00\\x00\\x00'\n\n\t# IPv6 prefixes are fully supported in the same tree\n\trnode = rtree.add(\"2001:DB8::/3\")\n\trnode = rtree.add(\"::/0\")\n\n\t# Use the nodes() method to return all RadixNodes created\n\tnodes = rtree.nodes()\n\tfor rnode in nodes:\n\t\tprint rnode.prefix\n\n\t# The prefixes() method will return all the prefixes (as a\n\t# list of strings) that have been entered\n\tprefixes = rtree.prefixes()\n\n\t# You can also directly iterate over the tree itself\n\t# this would save some memory if the tree is big\n\t# NB. Don't modify the tree (add or delete nodes) while\n\t# iterating otherwise you will abort the iteration and\n\t# receive a RuntimeWarning. Changing a node's data dict\n\t# is permitted.\n\tfor rnode in rtree:\n \t\tprint rnode.prefix\n\n\nLicense\n-------\n\npy-radix is licensed under a ISC/BSD licence. The underlying radix tree \nimplementation is taken (and modified) from MRTd and is subject to a 4-term \nBSD license. See the LICENSE file for details.\n\nContributing\n------------\n\nPlease report bugs via GitHub at https://github.com/mjschultz/py-radix/issues.\nCode changes can be contributed through a pull request on GitHub or emailed\ndirectly to me .\n\nThe main portions of the directory tree are as follows: ::\n\n .\n \u251c\u2500\u2500 radix/*.py # Pure Python code\n \u251c\u2500\u2500 radix/_radix.c # C extension code (compatible with pure python code)\n \u251c\u2500\u2500 radix/_radix/* # C extension code (compatible with pure python code)\n \u251c\u2500\u2500 tests/ # Tests (regression and unit)\n \u2514\u2500\u2500 setup.py # Standard setup.py for installation/testing/etc.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mjschultz/py-radix", "keywords": "radix tree trie python routing networking", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "py-radix", "package_url": "https://pypi.org/project/py-radix/", "platform": "", "project_url": "https://pypi.org/project/py-radix/", "project_urls": { "Homepage": "https://github.com/mjschultz/py-radix" }, "release_url": "https://pypi.org/project/py-radix/0.10.0/", "requires_dist": null, "requires_python": "", "summary": "Radix tree implementation", "version": "0.10.0" }, "last_serial": 3236504, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "3f9c6e07ee0e779b5a3de551f38be5ba", "sha256": "b8dbd1344bb30c6a1097d4103203c7b117d92931620365985018de4bef5aede3" }, "downloads": -1, "filename": "py-radix-0.10.0.tar.gz", "has_sig": false, "md5_digest": "3f9c6e07ee0e779b5a3de551f38be5ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21815, "upload_time": "2017-10-09T14:48:33", "url": "https://files.pythonhosted.org/packages/bf/4e/47d9e7f4dfd0630662e19d2cc1b2f1d307ec52df11f4a66f6ed6f0cce138/py-radix-0.10.0.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "d81007c6bd59787f5a1a1bdeab0643f4", "sha256": "ed469a00f149f040b14497e78532a68f07ff1268a9362ab0b3dffc8f3740db02" }, "downloads": -1, "filename": "py-radix-0.5.tar.gz", "has_sig": false, "md5_digest": "d81007c6bd59787f5a1a1bdeab0643f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15045, "upload_time": "2014-01-04T02:58:48", "url": "https://files.pythonhosted.org/packages/d1/98/4799a110f30e7e119c38f58a620e68d714a3432fc633b72d8327e4919cd7/py-radix-0.5.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "e381e4ae4a0745b4346c4052defc32c4", "sha256": "66c2ff90da11e33d004f9a83dc263cfe965d8ddbcf4dd89acd1db10e648c304f" }, "downloads": -1, "filename": "py-radix-0.6.0.tar.gz", "has_sig": false, "md5_digest": "e381e4ae4a0745b4346c4052defc32c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19278, "upload_time": "2014-04-23T17:12:40", "url": "https://files.pythonhosted.org/packages/64/1b/8bd5bb052c3633c77fa1109572ecb3042bdd4abb75b03326e1197b3af933/py-radix-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "77a8198976111dde5977d579fd938ecb", "sha256": "a980f447443e8054ed2e12b0e2ace77db061fddc2c06512221eb35a9c791227c" }, "downloads": -1, "filename": "py-radix-0.6.1.tar.gz", "has_sig": false, "md5_digest": "77a8198976111dde5977d579fd938ecb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19291, "upload_time": "2014-05-21T03:34:04", "url": "https://files.pythonhosted.org/packages/ba/30/dd1d799bbd20cda24f798a157b8461c06ec675602159a9114f3b6343f5b9/py-radix-0.6.1.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "3806121bc66a966734d297d7a5b5e0d2", "sha256": "8ae7cf5cc7427a44f90e12b0ee7be02abb46e441814cd0ebe1c22a743c30d42b" }, "downloads": -1, "filename": "py-radix-0.7.0.tar.gz", "has_sig": false, "md5_digest": "3806121bc66a966734d297d7a5b5e0d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19583, "upload_time": "2014-09-07T02:42:44", "url": "https://files.pythonhosted.org/packages/e8/f2/ea309801cdf0d22b2a85915e9fba15a634510b4add0962990dd734a3858e/py-radix-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "c918ca2cc60c5337e0b9fe07a8d43b18", "sha256": "8f1a92e7f346f9456a00688cfa09947eca5f81e75d22ae9625afb7e6f331d468" }, "downloads": -1, "filename": "py-radix-0.7.1.tar.gz", "has_sig": false, "md5_digest": "c918ca2cc60c5337e0b9fe07a8d43b18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19585, "upload_time": "2015-05-12T15:36:54", "url": "https://files.pythonhosted.org/packages/95/0e/ae10994331333bb1162b30990d9e84a747578d299c0361baa75a01b82d55/py-radix-0.7.1.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "6375016f993b1c43bee562f23a4d20fb", "sha256": "3cfa3c91a8b56c5808bbe8aa11523e688ba51c0cdd4860c84277c8a10bf40fd5" }, "downloads": -1, "filename": "py-radix-0.8.0.tar.gz", "has_sig": false, "md5_digest": "6375016f993b1c43bee562f23a4d20fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20014, "upload_time": "2015-05-19T14:00:28", "url": "https://files.pythonhosted.org/packages/34/a4/0bb2a65691773e4872179af5d2dc6653a7f7bbf6be95b93d461e2e7f2862/py-radix-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "e775e7977205ebbf8fe58910fa257b05", "sha256": "6db0a92de4fde1f04b464a3d6368be22d56b6f263a9307f0937503f46fcdd8fe" }, "downloads": -1, "filename": "py-radix-0.8.1.tar.gz", "has_sig": false, "md5_digest": "e775e7977205ebbf8fe58910fa257b05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20345, "upload_time": "2015-05-21T14:13:54", "url": "https://files.pythonhosted.org/packages/fc/71/f5d0efcd9db9ff47cc71097c68a3d3389b85cd081e0e206a0e3319a3c867/py-radix-0.8.1.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "bed51cfee391e041a2a2b79922b230bc", "sha256": "8b49078a4d7f2e84a0260604f51360d1e0b91efbf996f2e6acf168bd877716ae" }, "downloads": -1, "filename": "py-radix-0.9.0.tar.gz", "has_sig": false, "md5_digest": "bed51cfee391e041a2a2b79922b230bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20556, "upload_time": "2015-06-26T15:57:59", "url": "https://files.pythonhosted.org/packages/53/1a/275816a6c02b08ed705a8dd42d24ed143c86e5b4a833c6212515e3ce1baf/py-radix-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "624c05901b363931cf17d8d5dec60159", "sha256": "3e82475dfa1dbdde3537e8dbda05c1746c809d090f9d19467fe5ba0df9e0ace5" }, "downloads": -1, "filename": "py-radix-0.9.1.tar.gz", "has_sig": false, "md5_digest": "624c05901b363931cf17d8d5dec60159", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21512, "upload_time": "2015-07-14T20:56:32", "url": "https://files.pythonhosted.org/packages/82/17/fecac166cf6086ea6ef13abc586abfcaf9e20799aa532a97aee60be3bb10/py-radix-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "b93b28a599d2e9d8ccdb3aff9c93f479", "sha256": "87e17ea697e0b9af90fbe6858168bc598d11eef021b660c06c4b5acba8360383" }, "downloads": -1, "filename": "py-radix-0.9.2.tar.gz", "has_sig": false, "md5_digest": "b93b28a599d2e9d8ccdb3aff9c93f479", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21518, "upload_time": "2015-08-24T15:10:44", "url": "https://files.pythonhosted.org/packages/c2/6b/335d40344505002322945fd426e6dda97879e711a279218708818efa0b3f/py-radix-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "2b5456ae8ab03c7461eb364076afa2cb", "sha256": "03c0ff9ab4caf55a0499776a23ecd5caba5f7d9bbc7a894b1341e95400294f89" }, "downloads": -1, "filename": "py-radix-0.9.3.tar.gz", "has_sig": false, "md5_digest": "2b5456ae8ab03c7461eb364076afa2cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21854, "upload_time": "2015-09-10T18:31:01", "url": "https://files.pythonhosted.org/packages/cf/e7/c9b8a4c59b473957273179cafb92ed5705c4613699751a2279aa6c71d9e7/py-radix-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "efe5b8c628cba88e5ecbc3cc3e3b8438", "sha256": "ad27413e4599e2689f252dd71f143483b6ca39b12407ea245b8913853eef4008" }, "downloads": -1, "filename": "py-radix-0.9.4.tar.gz", "has_sig": false, "md5_digest": "efe5b8c628cba88e5ecbc3cc3e3b8438", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21880, "upload_time": "2016-03-24T02:35:40", "url": "https://files.pythonhosted.org/packages/09/1e/8eb9cde242ada3aadc135417dbf658dd542c3bb95d4494a1c73aedd82f1b/py-radix-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "fd1e27a950b1cafb3336aeb98749f426", "sha256": "ec08d1be8def975a182625dd189e0a9a9f69751f7da62dc3630c04bed9e8a8b6" }, "downloads": -1, "filename": "py-radix-0.9.5.tar.gz", "has_sig": false, "md5_digest": "fd1e27a950b1cafb3336aeb98749f426", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21879, "upload_time": "2016-04-26T21:09:29", "url": "https://files.pythonhosted.org/packages/9d/76/7a425bd4df7a3744da30cbfe9369b25ec379d51dc47a791d644c783e7d60/py-radix-0.9.5.tar.gz" } ], "0.9.6": [ { "comment_text": "", "digests": { "md5": "21d305625f6762cbccad0c0d939a1362", "sha256": "863b039265e860ab88e5e3a7ae8a25c57ed784ae6d150c30142ac6ed221b6db8" }, "downloads": -1, "filename": "py-radix-0.9.6.tar.gz", "has_sig": false, "md5_digest": "21d305625f6762cbccad0c0d939a1362", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21924, "upload_time": "2016-05-14T15:57:53", "url": "https://files.pythonhosted.org/packages/d8/53/8645b12a5624ec895b6439c28d41ee25dcada9a70ca2bea22d77b70b5457/py-radix-0.9.6.tar.gz" } ], "0.9.7": [ { "comment_text": "", "digests": { "md5": "2fbbd4d0eb5041fe7f884895e27e764f", "sha256": "a18034adde065585a93151535dfd3731d0bf1d88c3cc2562212bd7a61aeaaf51" }, "downloads": -1, "filename": "py-radix-0.9.7.tar.gz", "has_sig": false, "md5_digest": "2fbbd4d0eb5041fe7f884895e27e764f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21915, "upload_time": "2016-09-01T16:18:19", "url": "https://files.pythonhosted.org/packages/76/5a/229ac10c5f71fc63dd3e4c887610c351520c2badbdab1ddb126d3af7789c/py-radix-0.9.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3f9c6e07ee0e779b5a3de551f38be5ba", "sha256": "b8dbd1344bb30c6a1097d4103203c7b117d92931620365985018de4bef5aede3" }, "downloads": -1, "filename": "py-radix-0.10.0.tar.gz", "has_sig": false, "md5_digest": "3f9c6e07ee0e779b5a3de551f38be5ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21815, "upload_time": "2017-10-09T14:48:33", "url": "https://files.pythonhosted.org/packages/bf/4e/47d9e7f4dfd0630662e19d2cc1b2f1d307ec52df11f4a66f6ed6f0cce138/py-radix-0.10.0.tar.gz" } ] }