Skip to main content

UPnP for asyncio

Project description

Build Status codecov PyPI version Python 3.6 Python 3.7

UPnP for asyncio

aioupnp is a python 3.6/7 library and command line tool to interact with UPnP gateways using asyncio. aioupnp requires the netifaces module.

Supported devices

Actiontec GT784WN
D-Link DIR-890L
Cisco CGA4131COM
Linksys WRT1200AC
Netgear Nighthawk X4 AC2350


Verify the default python is python 3.6 or 3.7

python --version

Installation for normal usage

pip install aioupnp

Installation for development

git clone
cd aioupnp
pip install -e .


aioupnp [-h] [--debug_logging] [--interface=<interface>] [--gateway_address=<gateway_address>]
        [--lan_address=<lan_address>] [--timeout=<timeout>]
        [(--<case sensitive m-search header>=<value>)...]
        command [--<arg name>=<arg>]...

If m-search headers are provided as keyword arguments all of the headers to be used must be provided,
in the order they are to be used. For example:

aioupnp --HOST= --MAN=\"ssdp:discover\" --MX=1 --ST=upnp:rootdevice m_search


add_port_mapping | delete_port_mapping | get_external_ip | get_next_mapping | get_port_mapping_by_index | get_redirects | debug_gateway | generate_test_data | get_specific_port_mapping | m_search


To get the external ip address from the UPnP gateway

aioupnp get_external_ip

To list the active port mappings on the gateway

aioupnp get_redirects

To debug the default gateway

aioupnp --debug_logging m_search

To debug a gateway on a non default network interface

aioupnp --interface=vmnet1 --debug_logging m_search

To debug a gateway on a non default network interface that isn't the router

aioupnp --interface=vmnet1 --gateway_address= --debug_logging m_search


This project is MIT licensed. For the full license, see LICENSE.


The primary contact for this project is @jackrobison

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aioupnp, version 0.0.9
Filename, size File type Python version Upload date Hashes
Filename, size aioupnp-0.0.9.tar.gz (29.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page