Python ctypes SDK for the PP2P Rust core
Project description
Python SDK
This package is a ctypes bridge over the PP2P Rust C ABI.
Build native library first
Windows:
.\scripts\build_pp2p_core.ps1
Linux/macOS:
./scripts/build_pp2p_core_unix.sh
Install the Python SDK package (local)
pip install -e .\bindings\python
Example
from pp2p_core import Pp2pCore
core = Pp2pCore()
alice = core.generate_identity()
bob = core.generate_identity()
env = core.sign_envelope(
private_key_b64=alice["private_key_b64"],
sender_peer_id=alice["peer_id"],
recipient_peer_id=bob["peer_id"],
payload={"type": "hello", "text": "hi"},
nonce="n1",
)
core.verify_envelope(env, signer_public_key_b64=alice["public_key_b64"])
print("ok")
If the library is not in dist/pp2p_core/..., set PP2P_CORE_LIB to the absolute path.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pp2p_core_sdk-0.1.0.tar.gz
(2.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pp2p_core_sdk-0.1.0.tar.gz.
File metadata
- Download URL: pp2p_core_sdk-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f97570c024f460c5aa398096da3ff059dc9105f892a231858cdb1360f6b2542
|
|
| MD5 |
96e7ad6ab62f3f7276a51cc663aa8559
|
|
| BLAKE2b-256 |
601d5dab809a79fa4ccca7fc9a7bc1379d51fd577d98ec9575faf3c5bfb7bdc4
|
File details
Details for the file pp2p_core_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pp2p_core_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5596e1f842f090d8d8a6204b3d421aeea246e230912d812630bd75176b6c88d2
|
|
| MD5 |
49763cd2f03eaed5245fa2479444d74f
|
|
| BLAKE2b-256 |
27333021725a35d151a917d740155e930be58266647b1c6b1156f94af6f691d9
|