asyncping3


Nameasyncping3 JSON
Version 3.1.2 PyPI version JSON
download
home_pageNone
SummaryAn async-friendly pure python3 version of ICMP ping implementation using raw socket.
upload_time2024-07-18 10:40:29
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseThe MIT License (MIT) Copyright (c) 2016 Kyan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python3 anyio ping icmp socket tool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AsyncPing
![GitHub release](https://img.shields.io/github/release/M-o-a-T/asyncping.svg)
[![GitHub license](https://img.shields.io/github/license/M-o-a-T/asyncping.svg)](https://github.com/M-o-a-T/asyncping/blob/master/LICENSE)
![PyPI - Downloads](https://img.shields.io/pypi/dm/asyncping3.svg)

AsyncPing is an async-friendly pure python3 version of ICMP ping implementation using raw sockets.\
(Note that on Linux and Windows, ICMP messages can only be sent from processes running as root.)

> The Python2 version originally from [here](http://github.com/samuel/python-ping).\
> The Python3 version originally from [here](http://github.com/kyan001/ping3).\
> This version maintained at [this github repo](https://github.com/M-o-a-T/asyncping).

[CHANGELOG](CHANGELOG.md)

## Get Started

* If you met "permission denied", you may need to run this as root. Alternatively see [this](./TROUBLESHOOTING.md#permission-denied-on-linux) for troubleshooting on linux.

```sh
pip install asyncping3
```

```python
>>> from asyncping3 import ping, verbose_ping
>>> anyio.run(ping,'example.com')  # Returns delay in seconds.
0.215697261510079666

>>> anyio.run(verbose_ping,'example.com')  # Ping 4 times in a row.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms
```

```sh
$ pping example.com  # Verbose ping.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms
```

## Installation

```sh
pip install asyncping3  # install asyncping3
pip install --upgrade asyncping3  # upgrade asyncping3
pip uninstall asyncping3  # uninstall asyncping3
```

## Functions

```python
>>> from ping3 import ping, verbose_ping

>>> ping('example.com')  # Returns delay in seconds.
0.215697261510079666  # `0.0` returned means the delay is lower than the precision of `time.time()`.

>>> ping('not.exist.com')  # If host unknown (cannot resolve), returns False.
False

>>> ping("224.0.0.0")  # If timed out (no reply), returns None.
None

>>> ping('example.com', timeout=10)  # Set timeout to 10 seconds. Default timeout is 4 for 4 seconds.
0.215697261510079666

>>> ping('example.com', unit='ms')  # Returns delay in milliseconds. Default unit is 's' for seconds.
215.9627876281738

>>> ping('example.com', src_addr='192.168.1.15')  # Set source ip address for multiple interfaces. Default src_addr is None for no binding.
0.215697261510079666

>>> ping('example.com', interface='eth0')  # LINUX ONLY. Set source interface for multiple network interfaces. Default interface is None for no binding.
0.215697261510079666

>>> ping('example.com', ttl=5)  # Set packet Time-To-Live to 5. The packet is discarded if it does not reach the target host after 5 jumps. Default ttl is 64.
None

>>> ping('example.com', size=56)  # Set ICMP packet payload to 56 bytes. The total ICMP packet size is 8 (header) + 56 (payload) = 64 bytes. Default size is 56.
0.215697261510079666

>>> verbose_ping('example.com')  # Ping 4 times in a row.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms

>>> verbose_ping('example.com', timeout=10)  # Set timeout to 10 seconds. Default timeout is 4 for 4 seconds.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms

>>> verbose_ping('example.com', count=6)  # Ping 6 times. Default count is 4.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms

>>> verbose_ping('example.com', count=0)  # Ping endlessly (0 means infinite loops). Using `ctrl + c` to stop manully.
ping 'example.com' ... 215ms
...

>>> verbose_ping('example.com', src_addr='192.168.1.15')  # Ping from source IP address for multiple interfaces. Default src_addr is None.
ping 'example.com' from '192.168.1.15' ... 215ms
ping 'example.com' from '192.168.1.15' ... 216ms
ping 'example.com' from '192.168.1.15' ... 219ms
ping 'example.com' from '192.168.1.15' ... 217ms

>>> verbose_ping('example.com', interface='wifi0')  # LINUX ONLY. Ping from network interface 'wifi0'. Default interface is None.
ping 'example.com' from '192.168.1.15' ... 215ms
ping 'example.com' from '192.168.1.15' ... 216ms
ping 'example.com' from '192.168.1.15' ... 219ms
ping 'example.com' from '192.168.1.15' ... 217ms

>>> verbose_ping('example.com', unit='s')  # Displays delay in seconds. Default unit is "ms" for milliseconds.
ping 'example.com' ... 1s
ping 'example.com' ... 2s
ping 'example.com' ... 1s
ping 'example.com' ... 1s

>>> verbose_ping('example.com', ttl=5)  # Set TTL to 5. Default is 64.
ping 'example.com' ... Timeout
ping 'example.com' ... Timeout
ping 'example.com' ... Timeout
ping 'example.com' ... Timeout

>>> verbose_ping('example.com', interval=5)  # Wait 5 seconds between each packet. Default is 0.
ping 'example.com' ... 215ms  # wait 5 secs
ping 'example.com' ... 216ms  # wait 5 secs
ping 'example.com' ... 219ms  # wait 5 secs
ping 'example.com' ... 217ms

>>> verbose_ping('example.com', size=56)  # Set ICMP payload to 56 bytes. Default size is 56.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms
```

### DEBUG mode

Show more info for developers.

```python
>>> import asyncping3
>>> asyncping3.DEBUG = True  # Default is False.

>>> asyncping3.ping("example.com")  # "ping()" prints received IP header and ICMP header.
[DEBUG] IP HEADER: {'version': 69, 'tos': 0, 'len': 14336, 'id': 8620, 'flags': 0, 'ttl': 51, 'protocol': 1, 'checksum': *, 'src_addr': *, 'dest_addr': *}
[DEBUG] ICMP HEADER: {'type': 0, 'code': 0, 'checksum': 8890, 'id': 21952, 'seq': 0}
0.215697261510079666

>>> asyncping3.ping("example.com", timeout=0.0001)
[DEBUG] Request timeout for ICMP packet. (Timeout = 0.0001s)
None

>>> asyncping3.ping("not.exist.com")
[DEBUG] Cannot resolve: Unknown host. (Host = not.exist.com)
False

>>> asyncping3.ping("example.com", ttl=1)
[DEBUG] Time exceeded: Time To Live expired.
None
```

### EXCEPTIONS mode

Raise exceptions when there are errors instead of return None

```python
>>> import asyncping3, anyio, functools
>>> asyncping3.EXCEPTIONS = True  # Default is False.
>>> def pia(*a, **k):
...    return anyio.run(functools.partial(asyncping3.ping, *a, **k))

>>> pia("example.com", timeout=0.0001))  # All Exceptions are subclasses of PingError
[... Traceback ...]
ping3.errors.Timeout: Request timeout for ICMP packet. (Timeout = 0.0001s)

>>> pia("not.exist.com")
[... Traceback ...]
ping3.errors.HostUnknown: Cannot resolve: Unknown host. (Host = not.exist.com)

>>> pia("example.com", ttl=1)  # Linux need root privilege to receive TTL expired. Windows cannot get TTL expired.
[... Traceback ...]
ping3.errors.TimeToLiveExpired: Time exceeded: Time To Live expired.

>>> try:
>>>     pia("example.com", ttl=1)
>>> except asyncping3.errors.TimeToLiveExpired as err:
>>>     print(err.ip_header["src_addr"])  # TimeToLiveExpired, DestinationUnreachable and DestinationHostUnreachable have ip_header and icmp_header attached.
1.2.3.4  # IP address where the TTL happened.

>>> help(ping3.errors)  # More info about exceptions.

>>> try:
>>>     pia("invalid.com")
>>> except ping3.errors.HostUnknown:  # Specific error is catched.
>>>     print("Host unknown error raised.")
>>> except ping3.errors.PingError:  # All ping3 errors are subclasses of `PingError`.
>>>     print("A ping error raised.")
```

## Command Line Execution

Execute `pping` from command-line.
Note: `pping` needs `root` privilege to send/receive packets. You may want to use `sudo pping`.

```sh
$ pping --help  # -h/--help. Command-line help message.
$ python -m asyncping3 --help  # Same as 'ping3'. 'ping3' is an alias for 'python -m ping3'

$ pping -v  # -v/--version. Show asyncping3 version number.
3.0.0

$ pping example.com  # Verbose ping.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms

$ pping example.com 8.8.8.8  # Verbose ping all the addresses in parallel.
ping 'example.com' ... 215ms
ping 'example.com' ... 217ms
ping '8.8.8.8' ... 5ms
ping 'example.com' ... 216ms
ping '8.8.8.8' ... 2ms
ping '8.8.8.8' ... 6ms
ping 'example.com' ... 219ms
ping '8.8.8.8' ... 5ms

$ pping --count 1 example.com  # -c/--count. How many pings should be sent. Default is 4.
ping 'example.com' ... 215ms

$ pping --count 0 example.com  # Ping endlessly (0 means infinite loops). Using `ctrl + c` to stop manully.
...

$ pping --timeout 10 example.com  # -t/--timeout. Set timeout to 10 seconds. Default is 4.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms

$ pping --ttl 5 example.com  # -T/--ttl. # Set TTL to 5. Default is 64.
ping 'example.com' ... Timeout
ping 'example.com' ... Timeout
ping 'example.com' ... Timeout
ping 'example.com' ... Timeout

$ pping --size 56 example.com  # -s/--size. Set ICMP packet payload to 56 bytes. Default is 56.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms

$ pping --interval 5 example.com  # -i/--interval. Wait 5 seconds between each packet. Default is 0.
ping 'example.com' ... 215ms  # wait 5 secs
ping 'example.com' ... 216ms  # wait 5 secs
ping 'example.com' ... 219ms  # wait 5 secs
ping 'example.com' ... 217ms

$ pping --interface eth0 example.com  # -I/--interface. LINUX ONLY. The gateway network interface to ping from. Default is None.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms

$ pping --src 192.168.1.15 example.com  # -S/--src. Ping from source IP address for multiple network interfaces. Default is None.
ping 'example.com' ... 215ms
ping 'example.com' ... 216ms
ping 'example.com' ... 219ms
ping 'example.com' ... 217ms

$ pping --exceptions --timeout 0.001 example.com  # -E/--exceptions. EXCPETIONS mode is on when this shows up.
[... Traceback ...]
asyncping.errors.Timeout: Request timeout for ICMP packet. (Timeout = 0.0001s)

$ pping --debug --timeout 0.001 example.com  # -D/--debug. DEBUG mode is on when this shows up.
[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)
ping 'example.com' ... Timeout > 0.001s
[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)
ping 'example.com' ... Timeout > 0.001s
[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)
ping 'example.com' ... Timeout > 0.001s
[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)
ping 'example.com' ... Timeout > 0.001s
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "asyncping3",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "python3, anyio, ping, icmp, socket, tool",
    "author": null,
    "author_email": "Matthias Urlichs <matthias@urlichs.de>",
    "download_url": "https://files.pythonhosted.org/packages/27/1a/7327e8d3b75393119594dc7f1f547c0bb0bc1aae77a540c66cb6d71573e7/asyncping3-3.1.2.tar.gz",
    "platform": null,
    "description": "# AsyncPing\n![GitHub release](https://img.shields.io/github/release/M-o-a-T/asyncping.svg)\n[![GitHub license](https://img.shields.io/github/license/M-o-a-T/asyncping.svg)](https://github.com/M-o-a-T/asyncping/blob/master/LICENSE)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/asyncping3.svg)\n\nAsyncPing is an async-friendly pure python3 version of ICMP ping implementation using raw sockets.\\\n(Note that on Linux and Windows, ICMP messages can only be sent from processes running as root.)\n\n> The Python2 version originally from [here](http://github.com/samuel/python-ping).\\\n> The Python3 version originally from [here](http://github.com/kyan001/ping3).\\\n> This version maintained at [this github repo](https://github.com/M-o-a-T/asyncping).\n\n[CHANGELOG](CHANGELOG.md)\n\n## Get Started\n\n* If you met \"permission denied\", you may need to run this as root. Alternatively see [this](./TROUBLESHOOTING.md#permission-denied-on-linux) for troubleshooting on linux.\n\n```sh\npip install asyncping3\n```\n\n```python\n>>> from asyncping3 import ping, verbose_ping\n>>> anyio.run(ping,'example.com')  # Returns delay in seconds.\n0.215697261510079666\n\n>>> anyio.run(verbose_ping,'example.com')  # Ping 4 times in a row.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n```\n\n```sh\n$ pping example.com  # Verbose ping.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n```\n\n## Installation\n\n```sh\npip install asyncping3  # install asyncping3\npip install --upgrade asyncping3  # upgrade asyncping3\npip uninstall asyncping3  # uninstall asyncping3\n```\n\n## Functions\n\n```python\n>>> from ping3 import ping, verbose_ping\n\n>>> ping('example.com')  # Returns delay in seconds.\n0.215697261510079666  # `0.0` returned means the delay is lower than the precision of `time.time()`.\n\n>>> ping('not.exist.com')  # If host unknown (cannot resolve), returns False.\nFalse\n\n>>> ping(\"224.0.0.0\")  # If timed out (no reply), returns None.\nNone\n\n>>> ping('example.com', timeout=10)  # Set timeout to 10 seconds. Default timeout is 4 for 4 seconds.\n0.215697261510079666\n\n>>> ping('example.com', unit='ms')  # Returns delay in milliseconds. Default unit is 's' for seconds.\n215.9627876281738\n\n>>> ping('example.com', src_addr='192.168.1.15')  # Set source ip address for multiple interfaces. Default src_addr is None for no binding.\n0.215697261510079666\n\n>>> ping('example.com', interface='eth0')  # LINUX ONLY. Set source interface for multiple network interfaces. Default interface is None for no binding.\n0.215697261510079666\n\n>>> ping('example.com', ttl=5)  # Set packet Time-To-Live to 5. The packet is discarded if it does not reach the target host after 5 jumps. Default ttl is 64.\nNone\n\n>>> ping('example.com', size=56)  # Set ICMP packet payload to 56 bytes. The total ICMP packet size is 8 (header) + 56 (payload) = 64 bytes. Default size is 56.\n0.215697261510079666\n\n>>> verbose_ping('example.com')  # Ping 4 times in a row.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n\n>>> verbose_ping('example.com', timeout=10)  # Set timeout to 10 seconds. Default timeout is 4 for 4 seconds.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n\n>>> verbose_ping('example.com', count=6)  # Ping 6 times. Default count is 4.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\n\n>>> verbose_ping('example.com', count=0)  # Ping endlessly (0 means infinite loops). Using `ctrl + c` to stop manully.\nping 'example.com' ... 215ms\n...\n\n>>> verbose_ping('example.com', src_addr='192.168.1.15')  # Ping from source IP address for multiple interfaces. Default src_addr is None.\nping 'example.com' from '192.168.1.15' ... 215ms\nping 'example.com' from '192.168.1.15' ... 216ms\nping 'example.com' from '192.168.1.15' ... 219ms\nping 'example.com' from '192.168.1.15' ... 217ms\n\n>>> verbose_ping('example.com', interface='wifi0')  # LINUX ONLY. Ping from network interface 'wifi0'. Default interface is None.\nping 'example.com' from '192.168.1.15' ... 215ms\nping 'example.com' from '192.168.1.15' ... 216ms\nping 'example.com' from '192.168.1.15' ... 219ms\nping 'example.com' from '192.168.1.15' ... 217ms\n\n>>> verbose_ping('example.com', unit='s')  # Displays delay in seconds. Default unit is \"ms\" for milliseconds.\nping 'example.com' ... 1s\nping 'example.com' ... 2s\nping 'example.com' ... 1s\nping 'example.com' ... 1s\n\n>>> verbose_ping('example.com', ttl=5)  # Set TTL to 5. Default is 64.\nping 'example.com' ... Timeout\nping 'example.com' ... Timeout\nping 'example.com' ... Timeout\nping 'example.com' ... Timeout\n\n>>> verbose_ping('example.com', interval=5)  # Wait 5 seconds between each packet. Default is 0.\nping 'example.com' ... 215ms  # wait 5 secs\nping 'example.com' ... 216ms  # wait 5 secs\nping 'example.com' ... 219ms  # wait 5 secs\nping 'example.com' ... 217ms\n\n>>> verbose_ping('example.com', size=56)  # Set ICMP payload to 56 bytes. Default size is 56.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n```\n\n### DEBUG mode\n\nShow more info for developers.\n\n```python\n>>> import asyncping3\n>>> asyncping3.DEBUG = True  # Default is False.\n\n>>> asyncping3.ping(\"example.com\")  # \"ping()\" prints received IP header and ICMP header.\n[DEBUG] IP HEADER: {'version': 69, 'tos': 0, 'len': 14336, 'id': 8620, 'flags': 0, 'ttl': 51, 'protocol': 1, 'checksum': *, 'src_addr': *, 'dest_addr': *}\n[DEBUG] ICMP HEADER: {'type': 0, 'code': 0, 'checksum': 8890, 'id': 21952, 'seq': 0}\n0.215697261510079666\n\n>>> asyncping3.ping(\"example.com\", timeout=0.0001)\n[DEBUG] Request timeout for ICMP packet. (Timeout = 0.0001s)\nNone\n\n>>> asyncping3.ping(\"not.exist.com\")\n[DEBUG] Cannot resolve: Unknown host. (Host = not.exist.com)\nFalse\n\n>>> asyncping3.ping(\"example.com\", ttl=1)\n[DEBUG] Time exceeded: Time To Live expired.\nNone\n```\n\n### EXCEPTIONS mode\n\nRaise exceptions when there are errors instead of return None\n\n```python\n>>> import asyncping3, anyio, functools\n>>> asyncping3.EXCEPTIONS = True  # Default is False.\n>>> def pia(*a, **k):\n...    return anyio.run(functools.partial(asyncping3.ping, *a, **k))\n\n>>> pia(\"example.com\", timeout=0.0001))  # All Exceptions are subclasses of PingError\n[... Traceback ...]\nping3.errors.Timeout: Request timeout for ICMP packet. (Timeout = 0.0001s)\n\n>>> pia(\"not.exist.com\")\n[... Traceback ...]\nping3.errors.HostUnknown: Cannot resolve: Unknown host. (Host = not.exist.com)\n\n>>> pia(\"example.com\", ttl=1)  # Linux need root privilege to receive TTL expired. Windows cannot get TTL expired.\n[... Traceback ...]\nping3.errors.TimeToLiveExpired: Time exceeded: Time To Live expired.\n\n>>> try:\n>>>     pia(\"example.com\", ttl=1)\n>>> except asyncping3.errors.TimeToLiveExpired as err:\n>>>     print(err.ip_header[\"src_addr\"])  # TimeToLiveExpired, DestinationUnreachable and DestinationHostUnreachable have ip_header and icmp_header attached.\n1.2.3.4  # IP address where the TTL happened.\n\n>>> help(ping3.errors)  # More info about exceptions.\n\n>>> try:\n>>>     pia(\"invalid.com\")\n>>> except ping3.errors.HostUnknown:  # Specific error is catched.\n>>>     print(\"Host unknown error raised.\")\n>>> except ping3.errors.PingError:  # All ping3 errors are subclasses of `PingError`.\n>>>     print(\"A ping error raised.\")\n```\n\n## Command Line Execution\n\nExecute `pping` from command-line.\nNote: `pping` needs `root` privilege to send/receive packets. You may want to use `sudo pping`.\n\n```sh\n$ pping --help  # -h/--help. Command-line help message.\n$ python -m asyncping3 --help  # Same as 'ping3'. 'ping3' is an alias for 'python -m ping3'\n\n$ pping -v  # -v/--version. Show asyncping3 version number.\n3.0.0\n\n$ pping example.com  # Verbose ping.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n\n$ pping example.com 8.8.8.8  # Verbose ping all the addresses in parallel.\nping 'example.com' ... 215ms\nping 'example.com' ... 217ms\nping '8.8.8.8' ... 5ms\nping 'example.com' ... 216ms\nping '8.8.8.8' ... 2ms\nping '8.8.8.8' ... 6ms\nping 'example.com' ... 219ms\nping '8.8.8.8' ... 5ms\n\n$ pping --count 1 example.com  # -c/--count. How many pings should be sent. Default is 4.\nping 'example.com' ... 215ms\n\n$ pping --count 0 example.com  # Ping endlessly (0 means infinite loops). Using `ctrl + c` to stop manully.\n...\n\n$ pping --timeout 10 example.com  # -t/--timeout. Set timeout to 10 seconds. Default is 4.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n\n$ pping --ttl 5 example.com  # -T/--ttl. # Set TTL to 5. Default is 64.\nping 'example.com' ... Timeout\nping 'example.com' ... Timeout\nping 'example.com' ... Timeout\nping 'example.com' ... Timeout\n\n$ pping --size 56 example.com  # -s/--size. Set ICMP packet payload to 56 bytes. Default is 56.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n\n$ pping --interval 5 example.com  # -i/--interval. Wait 5 seconds between each packet. Default is 0.\nping 'example.com' ... 215ms  # wait 5 secs\nping 'example.com' ... 216ms  # wait 5 secs\nping 'example.com' ... 219ms  # wait 5 secs\nping 'example.com' ... 217ms\n\n$ pping --interface eth0 example.com  # -I/--interface. LINUX ONLY. The gateway network interface to ping from. Default is None.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n\n$ pping --src 192.168.1.15 example.com  # -S/--src. Ping from source IP address for multiple network interfaces. Default is None.\nping 'example.com' ... 215ms\nping 'example.com' ... 216ms\nping 'example.com' ... 219ms\nping 'example.com' ... 217ms\n\n$ pping --exceptions --timeout 0.001 example.com  # -E/--exceptions. EXCPETIONS mode is on when this shows up.\n[... Traceback ...]\nasyncping.errors.Timeout: Request timeout for ICMP packet. (Timeout = 0.0001s)\n\n$ pping --debug --timeout 0.001 example.com  # -D/--debug. DEBUG mode is on when this shows up.\n[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)\nping 'example.com' ... Timeout > 0.001s\n[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)\nping 'example.com' ... Timeout > 0.001s\n[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)\nping 'example.com' ... Timeout > 0.001s\n[DEBUG] Request timeout for ICMP packet. (Timeout = 0.001s)\nping 'example.com' ... Timeout > 0.001s\n```\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2016 Kyan  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "An async-friendly pure python3 version of ICMP ping implementation using raw socket.",
    "version": "3.1.2",
    "project_urls": {
        "Changelog": "https://github.com/M-o-a-T/asyncping3/blob/master/CHANGELOG.md",
        "Homepage": "https://github.com/M-o-a-T/asyncping3",
        "Issue Tracker": "https://github.com/M-o-a-T/asyncping3/issues",
        "Source Code": "https://github.com/M-o-a-T/asyncping3"
    },
    "split_keywords": [
        "python3",
        " anyio",
        " ping",
        " icmp",
        " socket",
        " tool"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "694fd3cf334777158c8244717852de420fad991f11c4109b7a24491cad25fa76",
                "md5": "61a2b26ce9615330860209ce31c4c127",
                "sha256": "c1ee423de3e45a5d66d1898f17fee9a7fd63c3e621e457148a6a06f804dda908"
            },
            "downloads": -1,
            "filename": "asyncping3-3.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "61a2b26ce9615330860209ce31c4c127",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 95163,
            "upload_time": "2024-07-18T10:40:27",
            "upload_time_iso_8601": "2024-07-18T10:40:27.386151Z",
            "url": "https://files.pythonhosted.org/packages/69/4f/d3cf334777158c8244717852de420fad991f11c4109b7a24491cad25fa76/asyncping3-3.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "271a7327e8d3b75393119594dc7f1f547c0bb0bc1aae77a540c66cb6d71573e7",
                "md5": "e95fa812f46ba75a9f69ef83a099eb83",
                "sha256": "5a487ed382d9ae7d336ffaffbb6664d9ab94b2aa4af7c262661d290d12bf5835"
            },
            "downloads": -1,
            "filename": "asyncping3-3.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e95fa812f46ba75a9f69ef83a099eb83",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 21560,
            "upload_time": "2024-07-18T10:40:29",
            "upload_time_iso_8601": "2024-07-18T10:40:29.006502Z",
            "url": "https://files.pythonhosted.org/packages/27/1a/7327e8d3b75393119594dc7f1f547c0bb0bc1aae77a540c66cb6d71573e7/asyncping3-3.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-18 10:40:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "M-o-a-T",
    "github_project": "asyncping3",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "asyncping3"
}
        
Elapsed time: 0.28466s