Bystroushaak's blog / English section / Explorations / Python p2p libraries and frameworks

Python p2p libraries and frameworks

I've explored the scene of the Python libraries and frameworks for peer to peer networking.

tldr; Its not that great.

πŸ‘‰
Note: asyncio-only code is considered disadvantageous. See What Color is Your Function? for explanation why. Basically it is a cancer that spreads through your whole program until everything is asyncio, and I like multiprocessing based on messages much more.

PyP2P

https://github.com/StorjOld/pyp2p

PyP2P is a simplified networking library for building peer-to-peer networks in Python. The library is designed to solve the pain of finding nodes and bypassing NATs so you can focus on writing your application code.

Somehow related to Storj.

Cons

Requires rendezvous server.

Last commit 2016

No documentation, some examples.

py-libp2p

https://github.com/libp2p/py-libp2p

Peer-to-peer networking stack (used by IPFS and others).

The one-liner pitch is that libp2p is a modular system of protocols, specifications, and libraries that enable the development of peer-to-peer network applications.

Pros

Last commit 2020.

Backed by ethereum grant.

Implementation of https://libp2p.io/, multiple languages supported.

Has some theory & capable people behind it. Looks mature enough.

Cons

Asyncio.

Not much documentation.

Some weird addressing stuff /ip4/127.0.0.1/tcp/8000/p2p/QmQn4SwGkDZKkUEpBRBvTmheQycxAHJUNmVEnjA2v1qe8Q

py-ipv8

https://github.com/tribler/py-ipv8/

What is IPv8 ?

IPv8 aims to provide authenticated communication with privacy. The design principle is to enable communication between public key pairs: IP addresses and physical network attachment points are abstracted away. This Python 2/3 package is an amalgamation of peer-to-peer communication functionality from Dispersy and Tribler, developed over the last 13 years by students and employees of the Delft University of Technology. The IPv8 library allows you to easily create network overlays on which to build your own applications.

IPv8 Objectives

Pros

Last commit 2020

Looks like it solves many problems.

Cons

Asyncio.

p2p-python

https://github.com/namuyan/p2p-python

I seek a library that can make a simple P2P network. This library enables you create P2P application.

Specification

Pros

Last commit 2020.

Pure python code.

Cons

Asyncio based

"simple" in the description.

Not much documentation, some examples.

Looks weird and amateurish.

Zyre

https://github.com/zeromq/zyre

Zyre provides reliable group messaging over local area networks.

Pros

Last commit 2020.

Bindings for various languages.

Cons

Requires bunch of C libraries.

Looks like it is meant for the LAN networks.

devp2p / ethereum

https://github.com/ethereum/devp2p

https://github.com/ethereum/trinity

Client for the ethereum network.

Doesn't seem to be easily use-able for standalone projects.

pydevp2p

https://github.com/ethereum/pydevp2p

Old library for lowlevel ethereum p2p.

pydevp2p is the Python implementation of the RLPx network layer. RLPx provides a general-purpose transport and interface for applications to communicate via a p2p network. The first version is geared towards building a robust transport, well-formed network, and software interface in order to provide infrastructure which meets the requirements of distributed or decentralized applications such as Ethereum. Encryption is employed to provide better privacy and integrity than would be provided by a cleartext implementation.

Cons

Last commit 2018.

Tandem

https://github.com/typeintandem/tandem

Tandem is a decentralized, collaborative text-editing solution. Tandem works with native text editors, works across different editors, and uses peer-to-peer connections to facilitate communication.

Tandem exists as a set of plugins for native text editors. We currently support Sublime Text 3 and Neovim. We also unofficially support Vim.

Collaborating is as easy as installing the plugin on your editor and creating a Tandem Session. Invite other people to your session, and get typing in tandem!

Cons

Requires rendezvous server

Meant as plugin for text editors, would probably require significant amount of work.

Dispersy

https://github.com/Tribler/dispersy

The elastic database system. A database designed for P2P-like scenarios, where potentially millions of computers send database updates around.

The Distributed Permission System, or Dispersy, is a platform to simplify the design of distributed communities. At the heart of Dispersy lies a simple identity and message handling system where each community and each user is uniquely and securely identified using elliptic curve cryptography.

Cons

No longer maintaned.

Banyan

https://github.com/OpenWeavers/banyan

Banyan is a simple peer to peer application protocol for File Sharing over LAN.

The workflow is organized as follows

  1. Initialization - Peer Starts up with a friendly name, which is visible on local network
  1. Peer Discovery - Peer Sends a broadcast to all other hosts in local network. Other peers will respond to it.
  1. Synchronization - Peer Receives file list from all other Peers
  1. Transfer - Peer can receive file from any other Peer

Cons

LAN only.

Last commit 2019.

Not really mature, no longer developed.

Peerstack

https://github.com/e9k/peerstack

Python Peer-to-Peer Framework.

Cons

Amateurish stuff (3 commits), no longer developed (last commit 2017).


Tags

explorations, p2p, python

Become a Patron