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+
  • Supported bundled-native targets:
    • Windows x64
    • Linux x64
    • macOS Intel (x64)
    • macOS Apple Silicon (arm64)

For unsupported targets, set PP2P_CORE_LIB to a compatible native library 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.2.0.tar.gz (3.1 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.2.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pp2p_core-0.2.0.tar.gz
  • Upload date:
  • Size: 3.1 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.2.0.tar.gz
Algorithm Hash digest
SHA256 e7a5ac4961144af31fc8274dfe19d75c206d112b4527fadc7c200b9827ab4738
MD5 a0371e8dfbdc095e4f8bf814b7ea73d6
BLAKE2b-256 463cc6b7ce282c3fedbc1bc966538043ecfe9f38a92b6de8ed53bd37adfd4db1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pp2p_core-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce0f47d104561522befd253634917aefb1f61cc91f31f824501e05c9420dd0d9
MD5 d35a96c8ddda5233781a470ec30f4c10
BLAKE2b-256 b76fd67576108badab1a649198bb04e0f503ebfe91e0f1a0c0f72d6144e3f965

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