{ "info": { "author": "Jathan McCollum", "author_email": "jathan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: Plugins", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", "Intended Audience :: Telecommunications Industry", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Education :: Testing", "Topic :: Internet", "Topic :: Internet :: Name Service (DNS)", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Networking", "Topic :: System :: Networking :: Firewalls", "Topic :: System :: Networking :: Monitoring", "Topic :: System :: Operating System", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "=======\nCIDRIZE\n=======\n\nIntelligently parse IPv4/IPv6 addresses, CIDRs, ranges, and wildcard matches to\nattempt return a valid list of IP addresses.\n\nThe ``cidrize()`` function does all the work trying to parse IP addresses correctly.\n\nSupported input formats\n-----------------------\n\nInput is very flexible and can be of any of the following formats::\n\n 192.0.2.18 \n 192.0.20.64/26\n 192.0.2.80-192.0.2.85\n 192.0.2.170-175\n 192.0.2.8[0-5]\n 192.0.2.[5678]\n\nHyphenated ranges do not need to form a CIDR block but the starting number must\nbe of lower value than the end. The ``netaddr`` module does most of the heavy\nlifting for us here.\n\nUnsupported formats\n-------------------\n\nNetwork mask (e.g. 192.0.2.0 255.255.255.0) and host mask (aka reverse mask,\n192.0.2.0 0.0.0.255) notation are not accepted at this time.\n\nThe cidrize function returns a list of consolidated ``netaddr.IPNetwork``\nobjects. By default parsing exceptions will raise a ``CidrizeError`` (with\ndefault argument of ``modular=True``). You may pass ``modular=False`` to cause\nexceptions to be stripped and the error text will be returned as a list. This\nis intended for use with scripts or APIs where receiving exceptions would not\nbe preferred.\n\nThe module may also be run as a script for debugging purposes.\n\n============\nDependencies\n============\n\n:`netaddr `_: Pythonic manipulation of\nIPv4, IPv6, CIDR, EUI and MAC network addresses\n\n=====\nUsage \n=====\n\nFire up your trusty old Python interpreter and follow along!\n\n::\n\n >>> from cidrize import cidrize\n\nOld-fashioned CIDR\n------------------\n\n::\n\n >>> cidrize(\"1.2.3.4\")\n [IPNetwork('1.2.3.4/32')]\n\nHyphenated range (default, strict=False)\n----------------------------------------\n\n::\n\n >>> cidrize(\"2.4.6.8-2.4.6.80\")\n [IPNetwork('2.4.6.0/25')]\n\nHyphenated range strict (strict=True)\n----------------------------------------\n\n::\n\n >>> cidrize(\"2.4.6.8-2.4.6.80\", strict=True)\n [IPNetwork('2.4.6.8/29'), IPNetwork('2.4.6.16/28'), \n IPNetwork('2.4.6.32/27'), IPNetwork('2.4.6.64/28'), \n IPNetwork('2.4.6.80/32')]\n\nWildcard\n--------\n\nYou may provide wildcards using asterisks. This is limited to the 4th and final octet only::\n\n >>> cidrize(\"15.63.148.*\")\n [IPNetwork('15.63.148.0/24')]\n\nBracketed range\n---------------\n\n::\n\n >>> cidrize(\"21.43.180.1[40-99]\")\n [IPNetwork('21.43.180.140/30'), IPNetwork('21.43.180.144/28'), \n IPNetwork('21.43.180.160/27'), IPNetwork('21.43.180.192/29')]\n\nBad!\n----\n\nBad CIDR prefixes are rejected outright::\n\n >>> cidrize(\"1.2.3.38/40\")\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"cidrize.py\", line 145, in cidrize\n raise CidrizeError(err)\n cidrize.CidrizeError: CIDR prefix /40 out of range for IPv4!\n\nWack range?!\n------------\n\nRanges must always start from lower to upper bound, or this happens::\n\n >>> cidrize(\"1.2.3.4-0\")\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"cidrize.py\", line 145, in cidrize\n raise CidrizeError(err)\n cidrize.CidrizeError: lower bound IP greater than upper bound!\n\n=========\nCidr Tool\n=========\n\nThe cidrize package also comes with the ``cidr`` command, which has two basic operations. \n\nSimple output::\n\n % cidr 1.2.3.4/30\n 1.2.3.4/30\n\nVerbose output::\n\n % cidr -v 1.2.3.4/30\n Spanning CIDR: 1.2.3.4/30\n Block Start/Network: 1.2.3.4\n 1st host: 1.2.3.5\n Gateway: 1.2.3.6\n Block End/Broadcast: 1.2.3.7\n DQ Mask: 255.255.255.252\n Cisco ACL Mask: 0.0.0.3\n # of hosts: 2\n Explicit CIDR blocks: 1.2.3.4/30\n\nAnd that's that!\n\n\n=======\nLicense\n=======\n\nCidrize is licensed under the `BSD 3-Clause License `_. Please see ``LICENSE.rst``\nfor the details.\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jathanism/cidrize/", "keywords": "Networking,Systems Administration,IANA,IEEE,CIDR,IP,IPv4,IPv6,IP Address,Firewalls,Security", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "cidrize", "package_url": "https://pypi.org/project/cidrize/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cidrize/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/jathanism/cidrize/" }, "release_url": "https://pypi.org/project/cidrize/0.6.4/", "requires_dist": null, "requires_python": null, "summary": "Cidrize parses IPv4/IPv6 addresses, CIDRs, ranges, and wildcard matches & attempts return a valid list of IP addresses", "version": "0.6.4" }, "last_serial": 787400, "releases": { "0.6": [ { "comment_text": "", "digests": { "md5": "18391a2b99dec37e9d94faf984754594", "sha256": "3b0659cba50295e0fce47bd3e19d740cc2c6a5214d27a635344b547c8b34fed3" }, "downloads": -1, "filename": "cidrize-0.6.tar.gz", "has_sig": false, "md5_digest": "18391a2b99dec37e9d94faf984754594", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9827, "upload_time": "2012-04-11T18:42:23", "url": "https://files.pythonhosted.org/packages/0d/c0/7a268f0daa713d3fb18f5e4d381b96673fee6a582d2eae31a6070e254074/cidrize-0.6.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "8f9005fae160e433d2ff12332f693e2a", "sha256": "cb6bf7f10622a12cf3f65389b9c8315fc5a0831b6889fe583ce867e31085e066" }, "downloads": -1, "filename": "cidrize-0.6.1.tar.gz", "has_sig": false, "md5_digest": "8f9005fae160e433d2ff12332f693e2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9890, "upload_time": "2012-04-11T18:53:12", "url": "https://files.pythonhosted.org/packages/46/37/2e727889d817b2b2006b2978f0a9c7fa6c6303c943d0be67ffc55691c0c0/cidrize-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "7acab21094463f780cfb4eb1cd49ae89", "sha256": "edc2e49afddebd15f9d75edae7fd036ab4589b929cacf6c0adbe59b9264bee15" }, "downloads": -1, "filename": "cidrize-0.6.2.tar.gz", "has_sig": false, "md5_digest": "7acab21094463f780cfb4eb1cd49ae89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9969, "upload_time": "2012-04-19T02:17:03", "url": "https://files.pythonhosted.org/packages/28/ec/04bc1f3aa7123aaa6e826adba1b1e761c5e93a15818a0f121d40dbf6dce7/cidrize-0.6.2.tar.gz" } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "fc0152c4870650dcb9f0b0f74a9ddac4", "sha256": "c60ca952be6ea60080aad358dd4a0098c90b9176bda4fe0924c6955b39d952c0" }, "downloads": -1, "filename": "cidrize-0.6.3.tar.gz", "has_sig": false, "md5_digest": "fc0152c4870650dcb9f0b0f74a9ddac4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11161, "upload_time": "2012-06-23T01:22:59", "url": "https://files.pythonhosted.org/packages/d2/99/c9fb4c6ab53c0e187f6bd9fdf329fcdacd1747a1af1aba64ffd35d6a57e3/cidrize-0.6.3.tar.gz" } ], "0.6.4": [ { "comment_text": "", "digests": { "md5": "0a3209e1dc76a3083a19d824763b480f", "sha256": "fd781b33dca2ceced97bb3621bb05de90da7bb58237d2646fd238fe30eacdbd4" }, "downloads": -1, "filename": "cidrize-0.6.4.tar.gz", "has_sig": false, "md5_digest": "0a3209e1dc76a3083a19d824763b480f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11192, "upload_time": "2013-02-12T17:07:01", "url": "https://files.pythonhosted.org/packages/79/d3/2558a0f7d3aa5dc7ea054c9467a5f42f8ed35d3c83dc1fe4a009bfc6cf26/cidrize-0.6.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0a3209e1dc76a3083a19d824763b480f", "sha256": "fd781b33dca2ceced97bb3621bb05de90da7bb58237d2646fd238fe30eacdbd4" }, "downloads": -1, "filename": "cidrize-0.6.4.tar.gz", "has_sig": false, "md5_digest": "0a3209e1dc76a3083a19d824763b480f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11192, "upload_time": "2013-02-12T17:07:01", "url": "https://files.pythonhosted.org/packages/79/d3/2558a0f7d3aa5dc7ea054c9467a5f42f8ed35d3c83dc1fe4a009bfc6cf26/cidrize-0.6.4.tar.gz" } ] }