Skip to main content

ap2p

Overview

ap2p is a package designed to facilitate peer-to-peer communication and data exchange. It provides a robust and efficient framework for building decentralized applications.

Features

  • No-nonsense API for peer-to-peer communication
  • Asynchronicity with modern python3 async / await syntax
  • Threading based on asyncio
  • Ease of use with clear documentation and examples
  • Easily extensible to accommodate various use cases

Installation

To install the package, use the following command:

pip install ap2p

Usage

Here's a basic example of how to use ap2p to start three interconnected nodes on localhost:

from asyncio import create_task, gather, run
from ipaddress import ip_address

from ap2p import Address, Node


LOCALHOST = ip_address("127.0.0.1")

PEERS = [
    Address(LOCALHOST, 8000),
    Address(LOCALHOST, 8001),
    Address(LOCALHOST, 8002),
]


for peer in peers:
    node = Node(address=peer)
    create_task(node.start(peers=peers))

Release files for ap2p 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ap2p 0.0.1
File Size Uploaded
ap2p-0.0.1.tar.gz 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ap2p 0.0.1
File Interpreter ABI Platform
ap2p-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size:19.3 kB

Release files / ap2p-0.0.1.tar.gz

Download URL ap2p-0.0.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c1dc97473b6ddad5fec21ca2e2dd175565cdd41841bbe1f744000dd4c2a6429f
BLAKE2b-256 checksum
How to use checksums
bbb4c765a849b7d7438baad33697d8d34985ebcafae92fe2207ff17b512105fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / ap2p-0.0.1-py3-none-any.whl

Download URL ap2p-0.0.1-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daad700d47148d46fbd2dc36362ec14cc8b1f0f9d57fd793b830d77b8b11decc
BLAKE2b-256 checksum
How to use checksums
d4c1de826050a80c6a03de7ab0f1b6933d7674229b5a848d3a53e3b35f5b08db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page