{ "info": { "author": "Hadi Asghari", "author_email": "hd.asghari@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Networking" ], "description": "pyasn\n=====\n\n.. image:: https://pypip.in/v/pyasn/badge.png\n :target: https://pypi.python.org/pypi/pyasn\n\n.. image:: https://pypip.in/d/pyasn/badge.png\n :target: https://pypi.python.org/pypi/pyasn\n\n\n**pyasn** is a Python extension module that enables very fast IP address to Autonomous System Number lookups.\nCurrent state and Historical lookups can be done, based on the MRT/RIB BGP archive used as input.\n\n*pyasn* is different from other ASN lookup tools in that it provides **offline** and **historical** lookups.\nIt provides utility scripts for users to build their own lookup databases based on any MRT/RIB archive.\nThis makes *pyasn* much faster than online dig/whois/json lookups.\n\nThe module is written in C and Python, and cross-compiles on Linux and Windows. Underneath, it uses a radix tree\ndata structure for storage of IP addresses. In the current version, it borrows code from *py-radix* to support\nboth IPV4 and IPV6 network prefixes. The current release is a beta. Compared to the previous version, it provides\nsupport for Python 2 and 3; adds new functionality, performance improvements, and unit-tests.\n\n*pyasn* is developed and maintained by researchers at the Economics of Cybersecurity research group at Delft\nUniversity of Technology (http://econsec.tbm.tudlft.nl). The package is used on an almost daily basis and bugs\nare fixed pretty quickly. The package is largely developed and maintained by Hadi Asghari and Arman Noroozian.\nPlease report any bugs via GitHub (https://github.com/hadiasghari/pyasn) or email the developers.\n\n\nInstallation\n============\nInstallation is a breeze via pip: ::\n\n pip install pyasn --pre\n\nOr with the standard Python: ::\n\n python setup.py build\n python setup.py install --record log\n\nYou will need to have pip, setuptools and build essentials installed if you build the package manually. On\nUbuntu/Debian you can get them using the following command: ::\n\n sudo apt-get install python-pip python-dev build-essential\n\nBuilding the C module on Windows, using either pip or from source, requires Microsoft Visual C++ to be installed.\npyasn has been tested using Visual C++ Express 2010, available freely from Microsoft's website, on both the\nofficial Python 3.4 release and Miniconda3. Other versions of Python, Visual Studio, and Cygwin could also work\nwith minor modifications.\n\nWe plan to release *pyasn* packages to major Linux repositories once it is out of beta.\n\n\nUsage\n=====\nA simple example that demonstrates most of the features: ::\n\n import pyasn\n\n # Initialize module and load IP to ASN database\n # the sample database can be downloaded or built - see below\n asndb = pyasn.pyasn('ipasn_20140513.dat')\n\n asndb.lookup('8.8.8.8')\n # should return: (15169, '8.8.8.0/24'), the origin AS, and the BGP prefix it matches\n\n asndb.get_as_prefixes(1128)\n # returns ['130.161.0.0/16', '131.180.0.0/16', '145.94.0.0/16'], TU-Delft prefixes\n\n\nIPASN Data Files\n================\nIPASN data files are a long list of prefixes used to lookup AS number for IPs. An excerpt from such a file looks\nlike this: ::\n\n ; IP-ASN32-DAT file\n ; Original file : \n ; Converted on : Tue May 13 22:03:05 2014\n ; CIDRs : 512490\n ;\n 1.0.0.0/24 15169\n 1.0.128.0/17 9737\n 1.0.128.0/18 9737\n 1.0.128.0/19 9737\n 1.0.129.0/24 23969\n ...\n\nIPASN data files can be created by downloading MRT/RIB BGP archives from Routeviews (or similar sources),\nand parsing them using provided scripts that tail the BGP AS-Path. This can be done simply as follows: ::\n\n pyasn_util_download.py --latest\n pyasn_util_convert.py --single \n\n\n**NOTE:** These scripts are by default installed to ``/usr/local/bin`` and can be executed directly. If you installed\nthe package to a user directory, these scripts will not be on the path and you will have to invoke them by navigating\nto the folder in which they have been copied (e.g. ``~/.local/bin``).\n\nWe also provide download links to a large number of previously generated IPASN data files. These are based on\nweekly snapshots of the Routeviews data from 2005-2015, accessible here:\nhttp://data.3tu.nl/repository/uuid:d4d23b8e-2077-4592-8b47-cb476ad16e12\n\n**New in v1.6:** To save disk space, you can gzip IPASN data files. The load time will be slighlty longer.\n\n\nPerformance Tip\n===============\nInitial loading of a IPASN data file is the most heavy operation of the package. For fast lookups using multiple\nIPASN data files, for instance for historical lookups on multiple dates, we recommend caching of loaded data files\nfor better performance.\n\n\nUninstalling pyasn\n==================\nYou can remove *pyasn* as follows: ::\n\n pip uninstall pyasn\n\nIf you built and installed the package your self use the recorded log to remove the installed files.\n\n**Removing PyASN version 1.2**: *pyasn* v1.5/1.6 and v1.2 can be installed side by side (due to lower-cased package\nname). To avoid mistakes, you can uninstall the old **PyASN** by deleting the following files from your Python\ninstallation: ::\n\n PYTHONDIR/dist-packages/PyASN.so\n PYTHONDIR/dist-packages/PyASN-1.2.egg-info\n\n\nPackage Structure\n=================\nThe main portions of the directory tree are as follows: ::\n\n .\n \u251c\u2500\u2500 pyasn/__init__.py # Python code of the main pyasn module\n \u251c\u2500\u2500 pyasn/pyasn_radix.c # C extension code (Python RADIX module with bulk load)\n \u251c\u2500\u2500 pyasn/_radix/* # C extension code (Based on original RADIX code from MRTd)\n \u251c\u2500\u2500 pyasn/mrtx.py # python module used to convert MRT files to pyasn DB files\n \u251c\u2500\u2500 pyasn-utils/*.py # Scripts to download & convert BGP MRT dumps to IPASN databases\n \u251c\u2500\u2500 data/ # Test Resources and some sample DBs to use\n \u251c\u2500\u2500 tests/ # Tests\n \u2514\u2500\u2500 setup.py # Standard setup.py for installation/testing/etc.\n\n\n\nTesting pyasn Sources\n=====================\nA limited number of unit tests are provided in the ``tests/`` directory when downlading the sources. They can be\nrun with the following command: ::\n\n python setup.py test\n\nThis beta release has been tested under python version 2.6, 2.7, 3.3, 3.4 and 3.5. We appreciate contributions towards\ntesting *pyasn*!\n\n**New in v1.6:** pyasn_util_convert.py offers a '--dump-screen' option which shows the MRT/RIB archive contents and\nthe chosen origin-AS.\n\n\nLicense & Acknowledgments\n=========================\n*pyasn* is licensed under the MIT license.\n\nIt extends code from py-radix (Michael J. Schultz and Damien Miller), and improves upon it in several ways, for\ninstance in lowering memory usage and adding bulk prefix/origin load. The underlying radix tree implementation is\ntaken (and modified) from MRTd. These are all subject to their respective licenses. Please see the LICENSE file\nfor details.\n\nThanks to Dr. Chris Lee (of Shadowserver) for proposing the use of radix trees.\n\nA handful of GitHub developers have contributed features and bug fixes to the latest releases.\nMany thanks to all of them.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hadiasghari/pyasn", "keywords": "ip asn autonomous system bgp whois prefix radix python routing networking", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyasn", "package_url": "https://pypi.org/project/pyasn/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyasn/", "project_urls": { "Homepage": "https://github.com/hadiasghari/pyasn" }, "release_url": "https://pypi.org/project/pyasn/1.6.0b1/", "requires_dist": null, "requires_python": null, "summary": "Offline IP address to Autonomous System Number lookup module.", "version": "1.6.0b1" }, "last_serial": 2580109, "releases": { "1.5.0b4": [ { "comment_text": "", "digests": { "md5": "e1aaf50fbd7ac3761863f218ca1d0cb0", "sha256": "cda25183cdb34a89e761b2c6bfc3498239c6fa0d4254d75214dc63950b199e8f" }, "downloads": -1, "filename": "pyasn-1.5.0b4.tar.gz", "has_sig": false, "md5_digest": "e1aaf50fbd7ac3761863f218ca1d0cb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31861, "upload_time": "2014-10-30T22:47:27", "url": "https://files.pythonhosted.org/packages/54/a7/4a36dd82a3cc84666a9f9da04100fff379c62c4223b4bdf07c3b9f9c4359/pyasn-1.5.0b4.tar.gz" } ], "1.5.0b5": [], "1.5.0b6": [ { "comment_text": "", "digests": { "md5": "b449ef11ecd9035c81d114ab635ed202", "sha256": "e91038f7a97c15be63a22b514c462b2f6eee70cf7cbd1c8539ab947c9313c96c" }, "downloads": -1, "filename": "pyasn-1.5.0b6.tar.gz", "has_sig": false, "md5_digest": "b449ef11ecd9035c81d114ab635ed202", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33506, "upload_time": "2014-11-05T13:44:30", "url": "https://files.pythonhosted.org/packages/e9/50/fc4384e4cea00b4cec35f401f18dfd9b910b7420766527f3680a45945e3b/pyasn-1.5.0b6.tar.gz" } ], "1.5.0b7": [ { "comment_text": "", "digests": { "md5": "faf97536967f67ec5458987238a04238", "sha256": "361ec1ae958c6bcd88653febbe35b2d0961f0b891ed988544327c0ae308bd521" }, "downloads": -1, "filename": "pyasn-1.5.0b7.tar.gz", "has_sig": false, "md5_digest": "faf97536967f67ec5458987238a04238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37319, "upload_time": "2016-02-09T19:20:56", "url": "https://files.pythonhosted.org/packages/59/19/c27c3cd9506de02f90cf2316d922e067f6abd487cf7ef166ea91962ddc88/pyasn-1.5.0b7.tar.gz" } ], "1.6.0b1": [ { "comment_text": "", "digests": { "md5": "f4556a3bcc6eb25eace37030202e3d90", "sha256": "d947900be23b073949b321c37d640b5ad86955704b7533b6f0519f550a5fa446" }, "downloads": -1, "filename": "pyasn-1.6.0b1.tar.gz", "has_sig": false, "md5_digest": "f4556a3bcc6eb25eace37030202e3d90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39806, "upload_time": "2017-01-17T16:41:11", "url": "https://files.pythonhosted.org/packages/31/da/c8338545be0ee7a727c977113e75888e4f1f2b2e10f9284fdfa31dab29bc/pyasn-1.6.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f4556a3bcc6eb25eace37030202e3d90", "sha256": "d947900be23b073949b321c37d640b5ad86955704b7533b6f0519f550a5fa446" }, "downloads": -1, "filename": "pyasn-1.6.0b1.tar.gz", "has_sig": false, "md5_digest": "f4556a3bcc6eb25eace37030202e3d90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39806, "upload_time": "2017-01-17T16:41:11", "url": "https://files.pythonhosted.org/packages/31/da/c8338545be0ee7a727c977113e75888e4f1f2b2e10f9284fdfa31dab29bc/pyasn-1.6.0b1.tar.gz" } ] }