{ "info": { "author": "Baptiste Jonglez", "author_email": "python@bitsofnetworks.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Internet", "Topic :: Scientific/Engineering" ], "description": "# About pywarts\n\n`pywarts` is a pure-python parsing library for the Warts format.\nWarts is an extensible binary format produced by\n[Scamper](http://www.caida.org/tools/measurement/scamper/), an\nInternet measurement tool from CAIDA, to store measurement results\nsuch as traceroutes and pings.\n\nThis library started off from the [Python implementation from\nCMAND](https://github.com/cmand/scamper), by Robert Beverly, but has\nnow vastly diverged. The parsing architecture is loosely inspired\nfrom the [Ryu](https://osrg.github.io/ryu/) packet parser, although it\nis less complex because the requirements are less stringent.\n\n## Installation\n\n```\npip install scamper-pywarts\n```\n\n## Features\n\n- pure-Python, no dependency, works with both python2 and python3\n- can read all basic Warts data types (ping, traceroute)\n- easily extensible for other Warts data types (patches are welcome)\n- nice class-based interface\n- reasonably good performance (a few minutes to parse a 80 MiB warts file with traceroute data)\n- streaming-like interface: no more than one record is pulled in\n memory at any given time, so it should handle very large Warts file\n with a limited amount of memory. You can probably even consume data\n directly from the output of a running Scamper process.\n\n## Using pywarts\n\nFor now, the only public API is very low-level: it simply reads from a\nstream (for instance a file) and returns Warts records as Python objects.\n\nTo read records, call `warts.parse_record` repeatedly until it returns\n`None`. Remember to open your input Warts files in binary mode!\n\nThe returned value of `warts.parse_record` is an instance of an\nappropriate subclass (e.g. `Traceroute`), depending on the record type.\nBe aware that all optional attributes are set to None if not present in\nthe input file. You should always check for this possibility in your user\ncode.\n\nHere is an example that opens a file, and repeatedly parses records\nuntil it finds a Traceroute record (warts files usually have a few\ninitial records with mostly uninteresting data).\n\n```\nimport warts\nfrom warts.traceroute import Traceroute\n\nwith open('my_file.warts', 'rb') as f:\n record = warts.parse_record(f)\n while not isinstance(record, Traceroute):\n record = warts.parse_record(f)\n if record.src_address:\n print(\"Traceroute source address:\", record.src_address)\n if record.dst_address:\n print(\"Traceroute destination address:\", record.dst_address)\n print(\"Number of hops:\", len(record.hops))\n print(record.hops)\n```\n\nTo know which attributes are available, look at the definition of the\nrelevant class (there will be real documentation at some point). For\ninstance, for `Traceroute`, almost all attributes are optional and defined\nhere:\n[traceroute.py](https://github.com/drakkar-lig/scamper-pywarts/blob/master/warts/traceroute.py#L34).\nSome attributes are not optional and are defined in the `parse()` method\nof the class. For instance, a traceroute object `t` always provides a\nlist of `TracerouteHop` objects in `t.hops`.\n\nIf parsing fails, an instance of `errors.ParseError` is thrown.\n`pywarts` generally tries to clean up after itself, so the file\ndescriptor should point to the next record even after a parsing error.\nOf course, this is not always possible, especially if the input file\nis incorrectly formatted.\n\n\n## Difference with the implementation from CMAND\n\nHere is some points on which `pywarts` improves from the code from\n:\n\n- fully python3-compatible\n- nicer class-based interface, instead of huge dicts with all flags\n- properly handles unknown flags and options, by ignoring them\n- attribute names have been generally made more readable (although\n that often means longer names)\n- possibly quite a bit faster (it would need proper benchmarks), because\n of the way we parse flags and strings. Also, we read a whole record\n into memory before parsing it, which is a bit faster than calling\n `read()` repeatedly on very small amount of data.\n\nHowever, there are some areas where the CMAND code does more things:\n\n- `pywarts` does not implement the deprecated address format (it is\n quite complex and has been deprecated for several years)\n- there are some nice scripts in ,\n for instance a script to attach to and control a running Scamper\n process\n\n# Developement\n\n## High-level\n\nSome currently unanswered questions:\n\n- What should the high-level API look like, and is there even a need\n for a higher-level API? Just an iterator of records? Allow to\n filter by record type? Try to parse further, for instance decode\n flags or produce different objects for UDP, TCP and ICMP\n traceroutes?\n- Should we try to normalise values when parsing? For instance,\n should we use `ipaddr` objects for addresses? Some times are\n expressed in centiseconds, some in microseconds, some in seconds.\n Should we normalize that to a common base? Are floats acceptable\n for time values?\n- What should we do when there is a parsing error? How can the user\n continue parsing the next record if he/she wants to?\n\nPlease open issues if you have ideas and thoughts on these questions.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/drakkar-lig/scamper-pywarts", "keywords": "Internet measurement scamper warts traceroute ping", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "scamper-pywarts", "package_url": "https://pypi.org/project/scamper-pywarts/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/scamper-pywarts/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/drakkar-lig/scamper-pywarts" }, "release_url": "https://pypi.org/project/scamper-pywarts/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Pure-python library allowing to read the Warts file format produced by Scamper (an Internet measurement tool from CAIDA)", "version": "0.2.1" }, "last_serial": 2283903, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c12fdced58a6c0c410ecdfc9b1688d4f", "sha256": "2ecb06ef8ed113925f69cf2b928152de2a0e2e187c2d5e502d5093c1f22ee5f4" }, "downloads": -1, "filename": "scamper_pywarts-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c12fdced58a6c0c410ecdfc9b1688d4f", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 12293, "upload_time": "2016-07-15T17:02:34", "url": "https://files.pythonhosted.org/packages/2c/59/6d6391db03acd605a36384e50ce4301d56e760eeb4a07f11fcb67f4a8820/scamper_pywarts-0.1.0-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "059b181f81031429e90d7635c1d15b37", "sha256": "dbc7b17c7244afa67bdba53328815b01576d58c4bcef897bbc31ec53b31027d3" }, "downloads": -1, "filename": "scamper_pywarts-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "059b181f81031429e90d7635c1d15b37", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 16980, "upload_time": "2016-07-20T14:13:09", "url": "https://files.pythonhosted.org/packages/7d/64/a22b770f535691c6dd298677a723d829d4f4e66d8a4128c02fb8b14119fb/scamper_pywarts-0.2.0-py2.py3-none-any.whl" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "620a390e79b4e67f656930d299d834d9", "sha256": "0b32ff1afdf8185ef33955a23117560539b63e594792aa9b4381a9f4a6b0dbc2" }, "downloads": -1, "filename": "scamper_pywarts-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "620a390e79b4e67f656930d299d834d9", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 17576, "upload_time": "2016-08-16T09:53:55", "url": "https://files.pythonhosted.org/packages/54/30/89bfd05a196c04d5a9fab0ede7fd407759f60835bd108a72a1e3189b6e79/scamper_pywarts-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cbb8137a48968849328edabf29b49c1d", "sha256": "ee457556b632e9a707174351c5fa0cf8c3115e5d206dbb830001aa78663b8231" }, "downloads": -1, "filename": "scamper-pywarts-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cbb8137a48968849328edabf29b49c1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11970, "upload_time": "2016-08-16T09:53:52", "url": "https://files.pythonhosted.org/packages/2b/a0/a6c8cf7f6ee146f16ec42309d4632edb88773f2776f05324af418f288318/scamper-pywarts-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "620a390e79b4e67f656930d299d834d9", "sha256": "0b32ff1afdf8185ef33955a23117560539b63e594792aa9b4381a9f4a6b0dbc2" }, "downloads": -1, "filename": "scamper_pywarts-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "620a390e79b4e67f656930d299d834d9", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 17576, "upload_time": "2016-08-16T09:53:55", "url": "https://files.pythonhosted.org/packages/54/30/89bfd05a196c04d5a9fab0ede7fd407759f60835bd108a72a1e3189b6e79/scamper_pywarts-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cbb8137a48968849328edabf29b49c1d", "sha256": "ee457556b632e9a707174351c5fa0cf8c3115e5d206dbb830001aa78663b8231" }, "downloads": -1, "filename": "scamper-pywarts-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cbb8137a48968849328edabf29b49c1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11970, "upload_time": "2016-08-16T09:53:52", "url": "https://files.pythonhosted.org/packages/2b/a0/a6c8cf7f6ee146f16ec42309d4632edb88773f2776f05324af418f288318/scamper-pywarts-0.2.1.tar.gz" } ] }