Python ctypes SDK for the PP2P Rust core
Project description
Python SDK
This package is a ctypes bridge over the PP2P Rust C ABI.
Install
pip install pp2p_core
Runtime requirements
- Python 3.9+
- Native PP2P core library (
pp2p_core.dll/libpp2p_core.so/libpp2p_core.dylib)
Build native library first:
Windows:
.\scripts\build_pp2p_core.ps1
Linux/macOS:
./scripts/build_pp2p_core_unix.sh
If the library is not in dist/pp2p_core/..., set PP2P_CORE_LIB to its absolute path.
Local dev install
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")
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-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-0.1.0.tar.gz.
File metadata
- Download URL: pp2p_core-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 |
f003906a7f92800084871c3f748d1160f2c2ac176255a2c86a8c3b68c7522ed6
|
|
| MD5 |
97c69b14a817ad37670440ee6139cbd8
|
|
| BLAKE2b-256 |
1d0ed1044fa84474c16f34ff1876876ede85c1188c2ccb4f473e9539259eb583
|
File details
Details for the file pp2p_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pp2p_core-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 |
f07f5bfbb49536dffef6a8464dbf83266f2c5eec67cb3dcb9aefb1a860d24423
|
|
| MD5 |
2a235cdd475bf6af1fd73ae99ad1baa0
|
|
| BLAKE2b-256 |
d93ce3538848e8c8cc0936bcc48fcb8b89593743b60bebe08b2cfbf1af8f1040
|