views:

1736

answers:

2

Hi,

I am searching for an open-source implementation of an UPnP client in Python, and more specifically of its Internet Gateway Device (IGD) part.

For now, I have only been able to find UPnP Media Server implementations, in projects such as PyMediaServer, PyMedS, BRisa or Coherence.

I am sure I could use those code bases as a start, but the Media Server part will introduce unneeded complexity.

So can you recommend a client UPnP (and hopefully IGD) Python library? An alternative would be to dispatch calls to a C library such as MiniUPnP, but I would much prefer a pure Python implementation.

Update: an interesting, kind of related discussion of SSDP and UPnP is available on StackOverflow.

+3  A: 

MiniUPnP source code contains a Python sample code using the C library as an extension module (see testupnpigd.py), which I consider as a proper solution to my problem.

Rationale: this is not the pure Python solution I was looking for, but:

  • significant effort has already been invested in this library,
  • it is lightweight (it does not address Media Server issues),
  • IGD is typically only used at connection setup, so not integrating it tighter with the Python code does not seem like an issue,
  • as a bonus, it also provides a NAT-PNP implementation (the Apple concurrent of IGD, part of Bonjour).
Tanelorn
+2  A: 

I think you should really consider BRisa. It recently became a pure python UPnP Framework, not focused only on Media Server.

It provides lots of utilitary modules and functions for you to build and deploy your UPnP device.

The project also is lacking feedback :-). I suggest you to use the latest svn code, if you're willing to try BRisa.

You can also contact the developers on #brisa at irc.freenode.org, we're either online or idling.

I spent some time studying your documentation, but I am looking for a very simple, modular library. BRisa did not feel that way IMHO.
Tanelorn