{ "info": { "author": "5kyc0d3r", "author_email": "5kyc0d3r@pm.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# UPnPy\n[![Build Status](https://travis-ci.org/5kyc0d3r/upnpy.svg?branch=master)](https://travis-ci.org/5kyc0d3r/upnpy)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/upnpy.svg)](https://pypi.org/project/UPnPy/)\n[![PyPI package version](https://img.shields.io/pypi/v/upnpy.svg)](https://pypi.org/project/UPnPy/)\n[![MIT License](https://img.shields.io/badge/license-MIT-red.svg)](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE)\n\nLightweight UPnP client library for Python.\n\n## Examples\n\n#### Get the external IP address of an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):\n```python\nimport upnpy\n\nupnp = upnpy.UPnP()\n\n# Discover UPnP devices on the network\n# Returns a list of devices e.g.: [Device ]\ndevices = upnp.discover()\n\n# Select the IGD\n# alternatively you can select the device directly from the list\n# device = devices[0]\ndevice = upnp.get_igd()\n\n# Get the services available for this device\n# Returns a list of services available for the device\n# e.g.: [, ...]\ndevice.get_services()\n\n# We can now access a specific service on the device by its ID\n# The IDs for the services in this case contain illegal values so we can't access it by an attribute\n# If the service ID didn't contain illegal values we could access it via an attribute like this:\n# service = device.WANPPPConnection\n\n# We will access it like a dictionary instead:\nservice = device['WANPPPConnection.1']\n\n# Get the actions available for the service\n# Returns a list of actions for the service:\n# [,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ]\nservice.get_actions()\n\n# Finally, get the external IP address\n# Execute the action by its name\n# Returns a dictionary: {'NewExternalIPAddress': 'xxx.xxx.xxx.xxx'}\nservice.GetExternalIPAddress()\n```\n\n#### Add a new port mapping to an [Internet Gateway Device](https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol):\n```python\nimport upnpy\n\nupnp = upnpy.UPnP()\n\n# Discover UPnP devices on the network\n# Returns a list of devices e.g.: [Device ]\ndevices = upnp.discover()\n\n# Select the IGD\n# alternatively you can select the device directly from the list\n# device = devices[0]\ndevice = upnp.get_igd()\n\n# Get the services available for this device\n# Returns a list of services available for the device\n# e.g.: [, ...]\ndevice.get_services()\n\n# We can now access a specific service on the device by its ID\n# The IDs for the services in this case contain illegal values so we can't access it by an attribute\n# If the service ID didn't contain illegal values we could access it via an attribute like this:\n# service = device.WANPPPConnection\n\n# We will access it like a dictionary instead:\nservice = device['WANPPPConnection.1']\n\n# Get the actions available for the service\n# Returns a list of actions for the service:\n# [,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ,\n# ]\nservice.get_actions()\n\n# The action we are looking for is the \"AddPortMapping\" action\n# Lets see what arguments the action accepts\n# Use the get_input_arguments() or get_output_arguments() method of the action\n# for a list of input / output arguments.\n# Example output of the get_input_arguments method for the \"AddPortMapping\" action\n# Returns a dictionary:\n# [\n# {\n# \"name\": \"NewRemoteHost\",\n# \"data_type\": \"string\",\n# \"allowed_value_list\": []\n# },\n# {\n# \"name\": \"NewExternalPort\",\n# \"data_type\": \"ui2\",\n# \"allowed_value_list\": []\n# },\n# {\n# \"name\": \"NewProtocol\",\n# \"data_type\": \"string\",\n# \"allowed_value_list\": [\n# \"TCP\",\n# \"UDP\"\n# ]\n# },\n# {\n# \"name\": \"NewInternalPort\",\n# \"data_type\": \"ui2\",\n# \"allowed_value_list\": []\n# },\n# {\n# \"name\": \"NewInternalClient\",\n# \"data_type\": \"string\",\n# \"allowed_value_list\": []\n# },\n# {\n# \"name\": \"NewEnabled\",\n# \"data_type\": \"boolean\",\n# \"allowed_value_list\": []\n# },\n# {\n# \"name\": \"NewPortMappingDescription\",\n# \"data_type\": \"string\",\n# \"allowed_value_list\": []\n# },\n# {\n# \"name\": \"NewLeaseDuration\",\n# \"data_type\": \"ui4\",\n# \"allowed_value_list\": []\n# }\n# ]\nservice.AddPortMapping.get_input_arguments()\n\n# Finally, add the new port mapping to the IGD\n# This specific action returns an empty dict: {}\nservice.AddPortMapping(\n NewRemoteHost='',\n NewExternalPort=80,\n NewProtocol='TCP',\n NewInternalPort=8000,\n NewInternalClient='192.168.1.3',\n NewEnabled=1,\n NewPortMappingDescription='Test port mapping entry from UPnPy.',\n NewLeaseDuration=0\n)\n```\n\n## Documentation\nDocumentation is available at [https://upnpy.readthedocs.io/en/latest/](https://upnpy.readthedocs.io/en/latest/)\n\n## License\nThis project is licensed under the terms of the [MIT License](https://github.com/5kyc0d3r/upnpy/blob/master/LICENSE).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/5kyc0d3r/upnpy", "keywords": "upnp,upnpy", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "UPnPy", "package_url": "https://pypi.org/project/UPnPy/", "platform": "", "project_url": "https://pypi.org/project/UPnPy/", "project_urls": { "Homepage": "https://github.com/5kyc0d3r/upnpy" }, "release_url": "https://pypi.org/project/UPnPy/1.1.5/", "requires_dist": null, "requires_python": "", "summary": "Lightweight UPnP client library for Python.", "version": "1.1.5" }, "last_serial": 5823030, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e9fc3be886a585e19f080a305d1d60fb", "sha256": "9b7b889402dbfb4888699aefb01c0d7bd7c3bcff4ea1dbdebe2429057d200d2d" }, "downloads": -1, "filename": "UPnPy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e9fc3be886a585e19f080a305d1d60fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13012, "upload_time": "2019-04-26T03:55:43", "url": "https://files.pythonhosted.org/packages/1a/f8/39048dacf012b70f9b8718cdb17974a76005f4631ff9753fb56885ae0092/UPnPy-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "4fb267d064d04c2f3cfae70725769ebf", "sha256": "26306fb9d010a82f0a72fe2358c3600842263c533ffce39e9ebb485908f1089b" }, "downloads": -1, "filename": "UPnPy-1.0.1.tar.gz", "has_sig": false, "md5_digest": "4fb267d064d04c2f3cfae70725769ebf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13968, "upload_time": "2019-04-26T04:03:38", "url": "https://files.pythonhosted.org/packages/cb/d4/c8f50b5ec9cd33995b8e3d17d44b8540133294f0d4f94d76523be1d667f8/UPnPy-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "234b7183e5f6f773c139d227125ad2b4", "sha256": "938af6ae097e7d7f90c1d4db65fe5a1060e0338f53692b22db818bda48958e79" }, "downloads": -1, "filename": "UPnPy-1.0.2.tar.gz", "has_sig": false, "md5_digest": "234b7183e5f6f773c139d227125ad2b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14087, "upload_time": "2019-04-26T04:06:13", "url": "https://files.pythonhosted.org/packages/0f/9d/c955dd46c6f4d534c09ac5f1f3e27d1c2aa078b73b6dc6e9d5f9d997f280/UPnPy-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "bcaa6a128dbd6661c0e6d6a9f39aed92", "sha256": "9fca017706d0b9f248bc93f68bdac3c28654957f2d0f4786e74c31757d6320e7" }, "downloads": -1, "filename": "UPnPy-1.0.3.tar.gz", "has_sig": false, "md5_digest": "bcaa6a128dbd6661c0e6d6a9f39aed92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14510, "upload_time": "2019-04-26T20:41:42", "url": "https://files.pythonhosted.org/packages/96/9d/00d5e73089582e5c462864dd74f922efc1009c6bf5a727a70c070961d4fb/UPnPy-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "5082cd9bbed712d464040755db9e4039", "sha256": "a9ca0a46b08d7099bb8fad79f2ca8f54e6e926d677aa6ebb4e3c4883d9559bab" }, "downloads": -1, "filename": "UPnPy-1.0.4.tar.gz", "has_sig": false, "md5_digest": "5082cd9bbed712d464040755db9e4039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14512, "upload_time": "2019-04-26T20:46:59", "url": "https://files.pythonhosted.org/packages/26/15/3bd39bd4d90fa38ec6c3ee6206bce74e0858bc6c615e1146ea116ea464ef/UPnPy-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "f2df9f320bfab2f3f374c622749cae38", "sha256": "9f5121a60b385cdefe22d0bdde8110adeef14116c0c5dac0ac5c9530638560b9" }, "downloads": -1, "filename": "UPnPy-1.1.0.tar.gz", "has_sig": false, "md5_digest": "f2df9f320bfab2f3f374c622749cae38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13267, "upload_time": "2019-04-30T17:02:21", "url": "https://files.pythonhosted.org/packages/0a/3d/a092303f56b9cec80c92febb55f5e3e1744f26a01ba2387854a800929049/UPnPy-1.1.0.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "657a208499669fa9266b698b93a7df63", "sha256": "ea8c4460c5cbcc265befb5c4ee0d204711ef106130f744ef48899db2c73c6365" }, "downloads": -1, "filename": "UPnPy-1.1.3.tar.gz", "has_sig": false, "md5_digest": "657a208499669fa9266b698b93a7df63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12875, "upload_time": "2019-04-30T17:29:42", "url": "https://files.pythonhosted.org/packages/b5/45/c6beeed7d08d8887efd005b3c369e43c33c5559ea3434a32f5e9dfd805e8/UPnPy-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "054b4e1914b91c097a57ed3ea87c24fa", "sha256": "f97564a955a9b88e2e78730b0747dd318cd58195e2d21a4bbdcec3211f12e9d2" }, "downloads": -1, "filename": "UPnPy-1.1.4.tar.gz", "has_sig": false, "md5_digest": "054b4e1914b91c097a57ed3ea87c24fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13002, "upload_time": "2019-09-12T22:57:04", "url": "https://files.pythonhosted.org/packages/d7/93/d5fb61e31927a73c6b8268ed62e5be871f2a891fb88d475d064e7a3c2726/UPnPy-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "3e5db62c3155a4c2c3b09ee3f09cd55b", "sha256": "88185068d13ffd3909949d9015b7a83c8e64648ba16de461a7755e4ac1096ef7" }, "downloads": -1, "filename": "UPnPy-1.1.5.tar.gz", "has_sig": false, "md5_digest": "3e5db62c3155a4c2c3b09ee3f09cd55b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13018, "upload_time": "2019-09-12T23:12:55", "url": "https://files.pythonhosted.org/packages/71/c0/d2c6c17771e10f72ca5da5519835db7a3313f5ed9dd80edc9246c5db3589/UPnPy-1.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3e5db62c3155a4c2c3b09ee3f09cd55b", "sha256": "88185068d13ffd3909949d9015b7a83c8e64648ba16de461a7755e4ac1096ef7" }, "downloads": -1, "filename": "UPnPy-1.1.5.tar.gz", "has_sig": false, "md5_digest": "3e5db62c3155a4c2c3b09ee3f09cd55b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13018, "upload_time": "2019-09-12T23:12:55", "url": "https://files.pythonhosted.org/packages/71/c0/d2c6c17771e10f72ca5da5519835db7a3313f5ed9dd80edc9246c5db3589/UPnPy-1.1.5.tar.gz" } ] }