{ "info": { "author": "Henrik Ankersoe", "author_email": "henrik@diblo.dk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Network Process Monitor\r\n_______________________\r\n\r\nNetwork Process Monitor makes it easy for Python developers to monitor a proccess' network usage.\r\n\r\nCurrently, it works with IPv4 and tested against Python 2.7.\r\n\r\n`Development site `__.\r\n\r\n\u00a9 Network Process Monitor contributors 2019 under the `The GNU General Public License v3.0 `__.\r\n\r\nInstallation\r\n-----------------------------\r\n\r\nInstall using `pip `__ with:\r\n\r\n pip install netprocmon\r\n\r\nOr, `download a wheel or source archive from PyPI `__.\r\n\r\nBasic\r\n-----------------------------\r\n\r\n >>> import time\r\n >>> from netprocmon import Monitor\r\n >>> pid = 586\r\n >>> with Monitor() as a:\r\n ... a.add_pid(pid)\r\n ... a.start()\r\n ... while True:\r\n ... time.sleep(5)\r\n ... print [str(n) for n in a.get_count_by_pid(pid)]\r\n ...\r\n ['NetworkTraffic(interface=eth1, recv=2302, pid=586, send=6806)']\r\n ['NetworkTraffic(interface=eth1, recv=2832, pid=586, send=9104)']\r\n ['NetworkTraffic(interface=eth1, recv=3548, pid=586, send=10742)', 'NetworkTraffic(interface=eth2, recv=0, pid=586, send=121)']\r\n\r\n\r\nListen address/interface\r\n-----------------------------\r\n\r\nLimit listening to an interface by providing the interface address\r\n\r\n >>> import time\r\n >>> from netprocmon import Monitor\r\n >>> pid = 586\r\n >>> with Monitor() as a:\r\n ... a.add_pid(pid)\r\n ... a.add_address(\"10.0.0.21\")\r\n ... a.start()\r\n ... while True:\r\n ... time.sleep(5)\r\n ... print [str(n) for n in a.get_count_by_pid(pid)]\r\n ...\r\n ['NetworkTraffic(interface=eth1, recv=530, pid=586, send=2758)']\r\n ['NetworkTraffic(interface=eth1, recv=1538, pid=586, send=5044)']\r\n ['NetworkTraffic(interface=eth1, recv=2386, pid=586, send=8166)']\r\n\r\n\r\nAvailable constants and methods\r\n---------------------------------\r\n\r\n=========\r\nConstants\r\n=========\r\n- **P_TCP**: Define the TCP protocol number\r\n- **P_UDP**: Define the UDP protocol number\r\n\r\n======================\r\nProcess Identification\r\n======================\r\n- **add_pid(PID)**: Add a process identification to have the traffic counted\r\n- **remove_pid(PID)**: Remove a process identification and the traffic count\r\n- **get_pids()**: Get a list of process identifications that get the traffic counted\r\n- **get_pid_by_port(proto, port)**: Get the process identification based on a supervise port\r\n- **clear_pids()**: Remove all process identifications\r\n\r\n=========\r\nListening\r\n=========\r\n- **add_address(addr)**: Add a listening restriction; The address should fit with an interface address\r\n- **get_addresses()**: Return a list of listening restrictions\r\n- **remove_address(addr)**: Remove a listening restriction\r\n- **clear_addresses()**: Remove all listening restriction\r\n- **get_listen_addrs()**: Return a list of interface addresses that are being listed to\r\n- **get_listen_interfaces()**: Return a list of interfaces with their addresses that are being listed to\r\n- **get_listen_interface_by_addr(addr)**: Return the interface name based on a address; If the address is not listened to, None will be returned\r\n\r\n===\r\nRun\r\n===\r\n- **start()**: Start the monitor\r\n\r\n============\r\nTraffic Info\r\n============\r\n- **get_count_by_pid(PID)**: Get network traffic based on a process identification\r\n\r\n=========\r\nPort Info\r\n=========\r\n- **get_ports_by_pid(PID)**: Get a list of supervise ports based on a process identification\r\n- **get_ports_by_proto(proto)**: Get a list of supervise ports based on TCP or UDP protocol; See P_TCP, P_UDP\r\n- **get_ports()**: Get a list of all supervise ports\r\n\r\n\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.python.org/pypi/netprocmon", "keywords": "", "license": "GPL v3", "maintainer": "", "maintainer_email": "", "name": "netprocmon", "package_url": "https://pypi.org/project/netprocmon/", "platform": "", "project_url": "https://pypi.org/project/netprocmon/", "project_urls": { "Homepage": "https://pypi.python.org/pypi/netprocmon" }, "release_url": "https://pypi.org/project/netprocmon/0.0.1rc7/", "requires_dist": null, "requires_python": "", "summary": "Network Process Monitor is a Python API to monitor process traffic", "version": "0.0.1rc7" }, "last_serial": 5775242, "releases": { "0.0.1rc6": [ { "comment_text": "", "digests": { "md5": "dff1adb9a209d108bb43caf30dc8d5a9", "sha256": "82b1841feaa3701d510ba7fada59fd8b13b432fad78a71c602b93685765e135b" }, "downloads": -1, "filename": "netprocmon-0.0.1rc6-py2-none-any.whl", "has_sig": false, "md5_digest": "dff1adb9a209d108bb43caf30dc8d5a9", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18643, "upload_time": "2019-08-24T18:58:16", "url": "https://files.pythonhosted.org/packages/a6/b9/8cca9f1bddebe95c40c51ef888558c74c05f448a400c7b25da665284c158/netprocmon-0.0.1rc6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d47dd148870615b2cafaacc6f55fc99", "sha256": "8aafc595ad3c81c2641688f26e7fe863fd70b0dd2c48174fa550a0a8647e64a8" }, "downloads": -1, "filename": "netprocmon-0.0.1rc6.tar.gz", "has_sig": false, "md5_digest": "2d47dd148870615b2cafaacc6f55fc99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17506, "upload_time": "2019-08-24T18:58:17", "url": "https://files.pythonhosted.org/packages/87/a2/030e9aec1747be08a98b6823a90f4774727292ce7e44f588d1c628000714/netprocmon-0.0.1rc6.tar.gz" } ], "0.0.1rc7": [ { "comment_text": "", "digests": { "md5": "7d6cf38bccede02b0612f671b18d0693", "sha256": "1a0b5f736e964b712d3b7100ba8ea54e4fedfce29dfbdfa20b6aa5473ce5cb2c" }, "downloads": -1, "filename": "netprocmon-0.0.1rc7-py2-none-any.whl", "has_sig": false, "md5_digest": "7d6cf38bccede02b0612f671b18d0693", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 19101, "upload_time": "2019-09-03T10:48:21", "url": "https://files.pythonhosted.org/packages/c3/39/49af1e4ec155b84dd7ecf004b8d594c305f6c0b2ab2ceb4261f7e3dcb582/netprocmon-0.0.1rc7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e50bd846e20a942460faf446335d120", "sha256": "f32535daa899f9be13754616c8477ed19036d814fe5fd7971f06cbac83e20b12" }, "downloads": -1, "filename": "netprocmon-0.0.1rc7.tar.gz", "has_sig": false, "md5_digest": "0e50bd846e20a942460faf446335d120", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17888, "upload_time": "2019-09-03T10:48:23", "url": "https://files.pythonhosted.org/packages/16/2c/e9a342f4d98df729fc84d12507c4a37580b82204713e8b90da8f8f47d021/netprocmon-0.0.1rc7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d6cf38bccede02b0612f671b18d0693", "sha256": "1a0b5f736e964b712d3b7100ba8ea54e4fedfce29dfbdfa20b6aa5473ce5cb2c" }, "downloads": -1, "filename": "netprocmon-0.0.1rc7-py2-none-any.whl", "has_sig": false, "md5_digest": "7d6cf38bccede02b0612f671b18d0693", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 19101, "upload_time": "2019-09-03T10:48:21", "url": "https://files.pythonhosted.org/packages/c3/39/49af1e4ec155b84dd7ecf004b8d594c305f6c0b2ab2ceb4261f7e3dcb582/netprocmon-0.0.1rc7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e50bd846e20a942460faf446335d120", "sha256": "f32535daa899f9be13754616c8477ed19036d814fe5fd7971f06cbac83e20b12" }, "downloads": -1, "filename": "netprocmon-0.0.1rc7.tar.gz", "has_sig": false, "md5_digest": "0e50bd846e20a942460faf446335d120", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17888, "upload_time": "2019-09-03T10:48:23", "url": "https://files.pythonhosted.org/packages/16/2c/e9a342f4d98df729fc84d12507c4a37580b82204713e8b90da8f8f47d021/netprocmon-0.0.1rc7.tar.gz" } ] }