pyping


Namepyping JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/toxinu/pyping/
SummaryA pure python ICMP ping implementation using raw sockets
upload_time2020-12-03 01:27:07
maintainer
docs_urlNone
authortoxinu
requires_python
licenseThe original code derived from ping.c distributed in Linux's netkit. That code is copyright (c) 1989 by The Regents of the University of California. That code is in turn derived from code written by Mike Muuss of the US Army Ballistic Research Laboratory in December, 1983 and placed in the public domain. They have my thanks. Copyright (c) Matthew Dixon Cowles, <http://www.visi.com/~mdc/>. Distributable under the terms of the GNU General Public License version 2. Provided with no warranties of any sort. See AUTHORS for complete list of authors and contributors.
keywords ping icmp network latency
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ======
Pyping
======

A pure python ping implementation using raw sockets.

Note that ICMP messages can only be sent from processes running as root
(in Windows, you must run this script as 'Administrator').

Original Version from Matthew Dixon Cowles.
  
* Copyleft 1989-2011 by the python-ping team, see `AUTHORS <https://raw.github.com/toxinu/pyping/master/AUTHORS>`_ for more details.
* License: GNU GPL v2, see `LICENCE <https://raw.github.com/toxinu/pyping/master/LICENSE>`_ for more details.

Usage
-----
Use as a cli tool::

    $ sudo pyping example.com

    PYTHON-PING example.com (92.243.5.143): 55 data bytes
    241 bytes from example.com (92.243.5.143): icmp_seq=0 ttl=55 time=64.5 ms
    241 bytes from example.com (92.243.5.143): icmp_seq=1 ttl=55 time=67.7 ms
    241 bytes from example.com (92.243.5.143): icmp_seq=2 ttl=55 time=66.6 ms

    ----example.com PYTHON PING Statistics----
    3 packets transmitted, 3 packets received, 0.0% packet loss
    round-trip (ms)  min/avg/max = 64.457/66.244/67.677

    $ pyping --help

Use as a Python lib::

    >>> import pyping
    >>> r = pyping.ping('example.com')                # Need to be root or
    >>> r = pyping.ping('example.com', udp = True)    # But it's udp, not real icmp
    >>> r.ret_code
    0
    >>> r.destination
    'example.com'
    >>> r.max_rtt
    '69.374'
    >>> r.avg_rtt
    '68.572'
    >>> r.min_rtt
    '67.681'
    >>> r.destination_ip
    '92.243.5.143'

Todo
----

- Docs
- Refactor core.py
- Tests

Contribute
----------

`Fork <http://help.github.com/fork-a-repo/>`_ this repo on `GitHub <https://github.com/toxinu/pyping>`_ and `send <http://help.github.com/send-pull-requests>`_ pull requests. Thank you.

Links
-----

 - Sourcecode at GitHub: https://github.com/toxinu/pyping
 - Python Package Index: http://pypi.python.org/pypi/pyping/


History
-------

2012-06-05
++++++++++

- Cleanup projet (by toxinu):
  - Add Cli parser
  - Can be used as python library
  - Added to pypi
  - Some Fixes
  - Clean

2011-10-17
++++++++++

- `Bugfix <https://github.com/jedie/python-ping/pull/6>`_ if host is unknown

2011-10-12
++++++++++

- Merge sources and create a seperate github `repository <https://github.com/jedie/python-ping>`_ and add a simple CLI interface.

2011-09-12
++++++++++

- Bugfixes + cleanup by Jens Diemer. Tested with Ubuntu + Windows 7.

2011-09-06
++++++++++

- `Cleanup <http://www.falatic.com/index.php/39/pinging-with-python>`_ by Martin Falatic : 
  - Restored lost comments and docs. Improved functionality: constant time between pings, internal times consistently use milliseconds. Clarified annotations (e.g., in the checksum routine)
  - Using unsigned data in IP & ICMP header pack/unpack unless otherwise necessary.
  - Signal handling
  - Ping-style output formatting and stats

2011-08-03
++++++++++

- Ported to py3k by Zach Ware. Mostly done by 2to3; also minor changes to deal with bytes vs. string changes (no more ord() in checksum() because >source_string< is actually bytes, added .encode() to data in send_one_ping()). That's about it.

2010-03-11
++++++++++

- Changes by Samuel Stauffer:
  - Replaced time.clock with default_timer which is set to time.clock on windows and time.time on other systems.

2009-11-08
++++++++++

- Fixes by `George Notaras <http://www.g-loaded.eu/2009/10/30/python-ping/>`_, reported by `Chris Hallman <http://cdhallman.blogspot.com>`_: 
  - Improved compatibility with GNU/Linux systems.
  - Re-use time.time() instead of time.clock(). The 2007 implementation worked only under Microsoft Windows. Failed on GNU/Linux. time.clock() behaves differently under the two `OSes <http://docs.python.org/library/time.html#time.clock>`_.

2007-06-30
++++++++++

- Little rewrite by `Jens Diemer <http://www.python-forum.de/post-69122.html#69122>`_:
  - Change socket asterisk import to a normal import
  - Replace time.time() with time.clock()
  - Delete "return None" (or change to "return" only)
  - In checksum() rename "str" to "source_string"

2000-12-04
++++++++++

- Changed the struct.pack() calls to pack the checksum and ID as unsigned. My thanks to Jerome Poincheval for the fix.

1997-12-16
++++++++++

For some reason, the checksum bytes are in the wrong order when this is run under Solaris 2.X for SPARC but it works right under Linux x86. Since I don't know just what's wrong, I'll swap the bytes always and then do an htons().

1997-11-22
++++++++++

Initial hack. Doesn't do much, but rather than try to guess what features I (or others) will want in the future, I've only put in what I need now.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/toxinu/pyping/",
    "name": "pyping",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ping icmp network latency",
    "author": "toxinu",
    "author_email": "toxinu@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/b6/97057e518f1df856583d164a61a755a698c6ab966e8633507f153e7b0d9b/pyping-0.0.6.tar.gz",
    "platform": "",
    "description": "======\nPyping\n======\n\nA pure python ping implementation using raw sockets.\n\nNote that ICMP messages can only be sent from processes running as root\n(in Windows, you must run this script as 'Administrator').\n\nOriginal Version from Matthew Dixon Cowles.\n  \n* Copyleft 1989-2011 by the python-ping team, see `AUTHORS <https://raw.github.com/toxinu/pyping/master/AUTHORS>`_ for more details.\n* License: GNU GPL v2, see `LICENCE <https://raw.github.com/toxinu/pyping/master/LICENSE>`_ for more details.\n\nUsage\n-----\nUse as a cli tool::\n\n    $ sudo pyping example.com\n\n    PYTHON-PING example.com (92.243.5.143): 55 data bytes\n    241 bytes from example.com (92.243.5.143): icmp_seq=0 ttl=55 time=64.5 ms\n    241 bytes from example.com (92.243.5.143): icmp_seq=1 ttl=55 time=67.7 ms\n    241 bytes from example.com (92.243.5.143): icmp_seq=2 ttl=55 time=66.6 ms\n\n    ----example.com PYTHON PING Statistics----\n    3 packets transmitted, 3 packets received, 0.0% packet loss\n    round-trip (ms)  min/avg/max = 64.457/66.244/67.677\n\n    $ pyping --help\n\nUse as a Python lib::\n\n    >>> import pyping\n    >>> r = pyping.ping('example.com')                # Need to be root or\n    >>> r = pyping.ping('example.com', udp = True)    # But it's udp, not real icmp\n    >>> r.ret_code\n    0\n    >>> r.destination\n    'example.com'\n    >>> r.max_rtt\n    '69.374'\n    >>> r.avg_rtt\n    '68.572'\n    >>> r.min_rtt\n    '67.681'\n    >>> r.destination_ip\n    '92.243.5.143'\n\nTodo\n----\n\n- Docs\n- Refactor core.py\n- Tests\n\nContribute\n----------\n\n`Fork <http://help.github.com/fork-a-repo/>`_ this repo on `GitHub <https://github.com/toxinu/pyping>`_ and `send <http://help.github.com/send-pull-requests>`_ pull requests. Thank you.\n\nLinks\n-----\n\n - Sourcecode at GitHub: https://github.com/toxinu/pyping\n - Python Package Index: http://pypi.python.org/pypi/pyping/\n\n\nHistory\n-------\n\n2012-06-05\n++++++++++\n\n- Cleanup projet (by toxinu):\n  - Add Cli parser\n  - Can be used as python library\n  - Added to pypi\n  - Some Fixes\n  - Clean\n\n2011-10-17\n++++++++++\n\n- `Bugfix <https://github.com/jedie/python-ping/pull/6>`_ if host is unknown\n\n2011-10-12\n++++++++++\n\n- Merge sources and create a seperate github `repository <https://github.com/jedie/python-ping>`_ and add a simple CLI interface.\n\n2011-09-12\n++++++++++\n\n- Bugfixes + cleanup by Jens Diemer. Tested with Ubuntu + Windows 7.\n\n2011-09-06\n++++++++++\n\n- `Cleanup <http://www.falatic.com/index.php/39/pinging-with-python>`_ by Martin Falatic : \n  - Restored lost comments and docs. Improved functionality: constant time between pings, internal times consistently use milliseconds. Clarified annotations (e.g., in the checksum routine)\n  - Using unsigned data in IP & ICMP header pack/unpack unless otherwise necessary.\n  - Signal handling\n  - Ping-style output formatting and stats\n\n2011-08-03\n++++++++++\n\n- Ported to py3k by Zach Ware. Mostly done by 2to3; also minor changes to deal with bytes vs. string changes (no more ord() in checksum() because >source_string< is actually bytes, added .encode() to data in send_one_ping()). That's about it.\n\n2010-03-11\n++++++++++\n\n- Changes by Samuel Stauffer:\n  - Replaced time.clock with default_timer which is set to time.clock on windows and time.time on other systems.\n\n2009-11-08\n++++++++++\n\n- Fixes by `George Notaras <http://www.g-loaded.eu/2009/10/30/python-ping/>`_, reported by `Chris Hallman <http://cdhallman.blogspot.com>`_: \n  - Improved compatibility with GNU/Linux systems.\n  - Re-use time.time() instead of time.clock(). The 2007 implementation worked only under Microsoft Windows. Failed on GNU/Linux. time.clock() behaves differently under the two `OSes <http://docs.python.org/library/time.html#time.clock>`_.\n\n2007-06-30\n++++++++++\n\n- Little rewrite by `Jens Diemer <http://www.python-forum.de/post-69122.html#69122>`_:\n  - Change socket asterisk import to a normal import\n  - Replace time.time() with time.clock()\n  - Delete \"return None\" (or change to \"return\" only)\n  - In checksum() rename \"str\" to \"source_string\"\n\n2000-12-04\n++++++++++\n\n- Changed the struct.pack() calls to pack the checksum and ID as unsigned. My thanks to Jerome Poincheval for the fix.\n\n1997-12-16\n++++++++++\n\nFor some reason, the checksum bytes are in the wrong order when this is run under Solaris 2.X for SPARC but it works right under Linux x86. Since I don't know just what's wrong, I'll swap the bytes always and then do an htons().\n\n1997-11-22\n++++++++++\n\nInitial hack. Doesn't do much, but rather than try to guess what features I (or others) will want in the future, I've only put in what I need now.\n",
    "bugtrack_url": null,
    "license": "The original code derived from ping.c distributed in Linux's netkit.\nThat code is copyright (c) 1989 by The Regents of the University of California.\nThat code is in turn derived from code written by Mike Muuss of the\nUS Army Ballistic Research Laboratory in December, 1983 and\nplaced in the public domain. They have my thanks.\n\nCopyright (c) Matthew Dixon Cowles, <http://www.visi.com/~mdc/>.\nDistributable under the terms of the GNU General Public License\nversion 2. Provided with no warranties of any sort.\n\nSee AUTHORS for complete list of authors and contributors.",
    "summary": "A pure python ICMP ping implementation using raw sockets",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/toxinu/pyping/"
    },
    "split_keywords": [
        "ping",
        "icmp",
        "network",
        "latency"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bb697057e518f1df856583d164a61a755a698c6ab966e8633507f153e7b0d9b",
                "md5": "674e194ad8ca6c6837419de7898da5db",
                "sha256": "0da3927380f308e2db83e2eaca32832a9538f2f6b4d2149b128b35ed988d33d2"
            },
            "downloads": -1,
            "filename": "pyping-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "674e194ad8ca6c6837419de7898da5db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8749,
            "upload_time": "2020-12-03T01:27:07",
            "upload_time_iso_8601": "2020-12-03T01:27:07.116409Z",
            "url": "https://files.pythonhosted.org/packages/0b/b6/97057e518f1df856583d164a61a755a698c6ab966e8633507f153e7b0d9b/pyping-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-12-03 01:27:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "toxinu",
    "github_project": "pyping",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyping"
}
        
Elapsed time: 0.16491s