Skip to main content

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.

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.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pp2p_core-0.1.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file pp2p_core-0.1.1.tar.gz.

File metadata

  • Download URL: pp2p_core-0.1.1.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

Hashes for pp2p_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 50b62e79927453166d0767947b69531c51a9584bf145a63df9922f372482f5f8
MD5 3e9d23f18e70defffd01eb6ebeae1ab2
BLAKE2b-256 a5f0a3199c1ae2f0f85836a69eee584e9db1f9fa4858917fd48828bb154badff

See more details on using hashes here.

File details

Details for the file pp2p_core-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pp2p_core-0.1.1-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

Hashes for pp2p_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ef813c9298a84473ee66037f87751cb66669049cb8a12b71eefd0ddd86d649b
MD5 9e6828215e55722ac8362ac124e6296d
BLAKE2b-256 33c523f88f886b85a8c9af30d4485f03ddf516b9a3e1b9f90dffede8ca68c2cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page