Python Library/Framework for writing P2P applications [closed]
Asked Answered
H

7

13

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.

Heirloom answered 8/6, 2009 at 3:5 Comment(0)
B
19

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.

Bushtit answered 8/6, 2009 at 3:5 Comment(2)
Divmod Vertex has seen a bit of maintenance recently. You can now find it at github.org/twisted/vertexMatter
@Jean-Paul Calderone is Vertex a working framework for p2p app or just in theory? The doc focuses more on philosophy than actually guiding.Qulllon
C
4

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.

Concrescence answered 8/6, 2009 at 4:1 Comment(2)
looks like the Vertex link is not valid nowPneumoencephalogram
@tdi yeah, unfortunately divmod server has suffered some hardware problems and there's no mirror. I can find Vertex source code at launchpad.net/divmod but not the docs I was linking before. If you can find a new Vertex documentation url to point to, please tell me, I'll update the answer. Thanks.Concrescence
S
3

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.

Schnorr answered 30/9, 2014 at 22:3 Comment(0)
J
2

I don't know if such a thing exists, though I can offer the following alternatives:

Jahdal answered 8/6, 2009 at 3:19 Comment(1)
Thanks for the answer. But currently I absolutely need CPython. Using JXTA-C seem too complicated for nowHeirloom
B
0

I quote from the Sun JXTA pages which have a December 2002 date,

"Project JXTA has a Java reference implementation available from download.jxta.org, and is currently working to add reference implementations in other common languages, including C, Objective C, Perl, Ruby, and Python. Though the Java implementation is the most complete implementation of the JXTA protocols, the C implementation (available for both Win32 and Linux) is fast approaching the same level of completeness."

Briant answered 8/6, 2009 at 3:21 Comment(1)
Unfortunately, the Python Implementation is far from being completeHeirloom
S
0

Hi (from the leader of the two last releases of JXTA for Java 2.6 & 2.7),

There is no known implementation of JXTA in Python.

If anyone wants to tackle this issue, one should learn about the JXTA 2.0 protocols first. The Practical JXTA II book available online for reading at Scribd should help understanding the technology.

Cheer!

Silvey answered 10/2, 2011 at 3:50 Comment(0)
L
-3

Stackless Python might be of interest to you.

Luttrell answered 8/6, 2009 at 3:30 Comment(1)
I'm not sure how this pertains to P2P applications?Redneck

© 2022 - 2024 — McMap. All rights reserved.