miniupnpc
MiniUPnP IGD client
What it is and what it does
miniupnpc is a Python binding to the MiniUPnPc C library, which implements the UPnP Control Point protocol for communicating with UPnP Internet Gateway Devices (routers). It allows Python applications to discover UPnP devices on the local network, query their capabilities, and manage port mappings—useful for applications that need to open ports for incoming connections without manual router configuration.
The package is designed for low footprint with minimal dependencies (libc only in the C layer). It ships as precompiled wheels across Linux, macOS, and Windows architectures. No runtime Python dependencies are required. The library has been maintained since 2005 in its C form, though the Python binding itself shows aging maintenance signals (last release 445 days ago).
Use it for:
- Peer-to-peer applications that need to automatically open inbound ports on the user's router for NAT traversal.
- Home automation or IoT applications discovering and controlling UPnP devices on a local network.
- Network diagnostic tools querying router capabilities and current port mapping configuration.
- BitTorrent or file-sharing clients automating port forwarding setup without user intervention.
- Game servers or streaming applications requesting temporary port mappings from the gateway device.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python binding for MiniUPnPc library that enables applications to communicate with UPnP Internet Gateway Devices on the network to manage port mappings and network configuration.
Yes, if you need UPnP port mapping automation with an active UPnP router. The permissive BSD license and zero runtime dependencies make it low-risk. Medium install friction (compiled wheels) is manageable for the platforms covered. Aging maintenance is not a blocker for stable functionality, but verify upstream security status and Python version support for your use case before committing.
Install
miniupnpc on PyPI
pip
pip install miniupnpcuv
uv add miniupnpcpoetry
poetry add miniupnpcInstalling miniupnpc
Before you install
Medium install friction due to compiled C extension wheels; prebuilt binaries available for common platforms. Last release 445 days ago; maintenance status is aging.
License in practice
BSD 3-Clause License (permissive); allows commercial and private use with attribution and liability disclaimer. No restrictions on redistribution or modification.
Quickstart
import miniupnpc
upnp = miniupnpc.UPnP()
upnp.discover()
upnp.selectIGD()
Requires an active UPnP-enabled Internet Gateway Device on the local network; will fail silently if none is present or UPnP is disabled on the router.
Verify before relying
- Whether the package supports Python versions beyond those with prebuilt wheels.
- Current state of upstream MiniUPnPc library and any known security advisories not yet reflected in OSV.
- Whether the aging maintenance status reflects active upstream development or stable/dormant state.
Package facts
| License | BSD 3-Clause License Copyright (c) 2005-2025, Thomas BERNARD All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the… (full text in the JSON record) (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 445 days since the last release |
| First released | |
| Downloads | 77,871/month — #14,487 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: miniupnpc-2.3.3-cp310-cp310-macosx_13_0_arm64.whl; miniupnpc-2.3.3-cp310-cp310-macosx_13_0_universal2.whl; miniupnpc-2.3.3-cp310-cp310-macosx_13_0_x86_64.whl; miniupnpc-2.3.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl; miniupnpc-2.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; miniupnpc-2.3.3-cp310-cp310-win32.whl; miniupnpc-2.3.3-cp310-cp310-win_amd64.whl; miniupnpc-2.3.3-cp311-cp311-macosx_13_0_arm64.whl; miniupnpc-2.3.3-cp311-cp311-macosx_13_0_universal2.whl; miniupnpc-2.3.3-cp311-cp311-macosx_13_0_x86_64.whl; miniupnpc-2.3.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; miniupnpc-2.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; miniupnpc-2.3.3-cp311-cp311-win32.whl; miniupnpc-2.3.3-cp311-cp311-win_amd64.whl; miniupnpc-2.3.3-cp312-cp312-macosx_13_0_arm64.whl; miniupnpc-2.3.3-cp312-cp312-macosx_13_0_universal2.whl; miniupnpc-2.3.3-cp312-cp312-macosx_13_0_x86_64.whl; miniupnpc-2.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; miniupnpc-2.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; miniupnpc-2.3.3-cp312-cp312-win32.whl
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
async-upnp-clientAsync UPnP client library for discovering,…
permissive · top 15,000 on PyPI
python-songpalPython library for controlling Sony audio…
copyleft · top 15,000 on PyPI
midea-localControl Midea M-Smart appliances over local…
permissive · top 15,000 on PyPI
wiimwiim provides a Python API to discover,…
permissive · top 15,000 on PyPI
btsocketA Python library for controlling BlueZ…
permissive · top 15,000 on PyPI
broadlinkA Python module and CLI for discovering,…
permissive · top 15,000 on PyPI
elasticsearch5Low-level Python client for Elasticsearch 5.x…
permissive · top 15,000 on PyPI
tinytuyaControls and monitors Tuya WiFi smart devices…
permissive · top 15,000 on PyPI
pyudevpyudev is a pure Python binding for libudev…
copyleft · top 5,000 on PyPI
libsoundtouchControl Bose Soundtouch devices over the…
permissive · top 15,000 on PyPI