Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Library/Framework for writing P2P applications [closed]

Is there any library or framework for writing P2P applications in Python ?

I know the initial Bittorrent client was written in Python. I'm looking something like JXTA but for Python.

like image 801
Manuel Ceron Avatar asked Jun 08 '09 03:06

Manuel Ceron


3 Answers

Twisted is pretty much the answer to anything seriously network-related in Python, but you really have to buy into the Twisted way of doing things. It's not intrinsically a P2P stack, it's an event loop, callback system and networking framework.

Divmod Vertex is not currently being maintained, and was still pretty rough when I tried using it a few years ago.

CSpace might be the closest to what you're looking for: "a platform for secure, decentralized, user-to-user communication over the internet." It abstracts the P2P and NAT traversal out so your app can act normally and not be "a P2P app."

Similarly, there was an old P2P system out of Australia called "The Circle" a few years ago, written entirely in Python, which had secure P2P messaging, chat, file sharing and other features. 0.41c was the last version: http://savannah.nongnu.org/projects/circle/

Also from my bookmarks:

http://entangled.sourceforge.net/ is Entangled, "a distributed hash table (DHT) based on Kademlia, as well as a peer-to-peer tuple space implementation."

http://khashmir.sourceforge.net/ is a Python distributed hash table, notable because it networks using the Airhook protocol, which is very fault-tolerant (designed for use e.g. over cellular networks).

http://kenosis.sourceforge.net/ is a Python P2P RPC system.

like image 59
Vitorio Avatar answered Nov 20 '22 07:11

Vitorio


Best option I can think, of course, is to use twisted.

Old version of BitTorrent was built with it. The link is to last known version that uses twisted. You can study that as a starting point.

There's also Vertex. It is a library that uses twisted and allows p2p with firewall bypassing.

like image 20
nosklo Avatar answered Nov 20 '22 06:11

nosklo


Since this question was asked and subsequently answered, ZeroMQ has emerged, and I REALLY like it. The Python module is called pyzmq. It makes the process building TCP sockets way less clunky, especially when dealing with message patterns other than Request>Respond, though it does that as well. It's great for basic servers, p2p apps, messaging, distributed processing, you name it.

like image 3
Travis Hoogendoorn Avatar answered Nov 20 '22 06:11

Travis Hoogendoorn