{"id":15576342,"url":"https://github.com/damnever/dping","last_synced_at":"2025-07-13T06:40:32.974Z","repository":{"id":141674700,"uuid":"46471321","full_name":"damnever/dping","owner":"damnever","description":"A simple *ping* program written in Python.","archived":false,"fork":false,"pushed_at":"2016-01-17T15:08:17.000Z","size":816,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T19:51:21.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/damnever/dping","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/damnever.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-19T06:04:52.000Z","updated_at":"2020-11-13T12:11:59.000Z","dependencies_parsed_at":"2023-03-27T12:49:56.259Z","dependency_job_id":null,"html_url":"https://github.com/damnever/dping","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damnever%2Fdping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damnever%2Fdping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damnever%2Fdping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damnever%2Fdping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/damnever","download_url":"https://codeload.github.com/damnever/dping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248082786,"owners_count":21044976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T18:46:46.638Z","updated_at":"2025-04-09T17:50:20.462Z","avatar_url":"https://github.com/damnever.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"A simple ping program written in Python.\n====================================\n\n.. image:: https://github.com/Damnever/dping/blob/master/view.png\n    :target: https://raw.githubusercontent.com/Damnever/pigar/master/view.png\n\nTested it on Ubuntu 15.04(3.19.0-34-generic).\n\nGet started\n----------\n\nInstall it from GitHub with ``pip``, you must use **root permission**: ::\n\n    sudo pip install git+https://github.com/Damnever/dping.git@master\n\nRun it, **root permission** is also required, no optional arguments: ::\n\n    sudo dping example-site.com\n\nThat's it. You can learn more from the source code.\n\nAbout the C extension\n-------------------\n\nThe reason to write the C extension is I want to block ``SIGINT`` when a ping request-response cycle is not finished. And, the Python signal module is weak, it can not support for pending a signal.\n\nYou can consider the situation like this: it sends a ICMP packet to destination, and it increases transmitted counter value, it waiting for receiving a ICMP response packet, then it increases received counter value. If it sends a packet then you enter ``Ctrl+C``, then the program will be interrupted, it will loss the ICMP response packet and received counter value, so the loss rate is not exactly incorrect.\n\nWhy don't I just throw the last counter value away? Because I do not wanna do this, I want to learn more and ...\n\nThe C extension is usefull. For example:\n\n.. code:: python\n\n    import time\n    import signal\n\n    from dping.sigpending import sigpending\n\n\n    def main():\n        try:\n            with sigpending(signal.SIGINT):\n                print('Doing sth.')\n                for i in range(1, 6):\n                    time.sleep(1)\n                    print('{0} sec passed!'.format(i))\n                print('Done.')\n        except KeyboardInterrupt:\n            print('\\nInterruped')\n\n    if __name__ == '__main__':\n        main()\n\nOuput(``^C`` is ``Ctrl+C``): ::\n\n    Doing sth.\n    1 sec passed!\n    ^C2 sec passed!\n    3 sec passed!\n    4 sec passed!\n    5 sec passed!\n    Done.\n\n    Interruped\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamnever%2Fdping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamnever%2Fdping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamnever%2Fdping/lists"}