Skip to main content

[!WARNING] This is an unstable version. Changes may be backwards incompatible

py-pletyvo

PyPI - Version PyPI - License PyPI - Python Version

Typed, async‑first Python client for the Pletyvo decentralized platform and it's protocols (Python ≥ 3.9)

Install

pip install -U pletyvo

Usage

Engine

To begin using the client, you need to create an engine — the core component responsible for all communication with the Pletyvo gateway. You can create one using pletyvo.DefaultEngine:

import pletyvo

engine: pletyvo.abc.Engine = pletyvo.DefaultEngine(
    config=pletyvo.Config(
        url="http://testnet.pletyvo.osyah.com",
        network="AAEAAAAB",
    ),
)

The pletyvo.Config accepts:

  • url: The gateway endpoint.
  • network | None: the network identifier encoded as a base64 string. By default, has an already set network on the node side

Service

A service is a high-level interface that aggregates protocol-specific HTTP services. This top-level object internally composes pletyvo.DAppService & pletyvo.DeliveryService. The service requires a signer — an object responsible for producing cryptographic signatures over event bodies. The signer must implement the dapp.abc.Signer interface.

import pletyvo

service = pletyvo.Service.di(
    engine=engine,
    signer=signer,
)

Want full control?

You can instantiate each service manually by passing required dependencies.

import pletyvo

service = pletyvo.Service(
    dapp=pletyvo.DAppService(
        hash=pletyvo.HashService(...),
        event=pletyvo.EventService(...),
    ),
    delivery=pletyvo.DeliveryService(
        channel=pletyvo.ChannelService(...),
        post=pletyvo.PostService(...),
        message=pletyvo.MessageService(...),
    )
)

Dependency graph

pletyvo-dependency-graph

dApp

Platform docs: dApp

The dApp protocol defines how signed events are created, verified, and published on the Pletyvo network. Each dapp.Event consists of dapp.EventBody and a corresponding signature, both of which are required for persistence. You can create a dApp service using either the shorthand or manual constructor:

The dApp service itself does not construct or validate signatures — it only transmits fully-formed signed events.

import pletyvo

dapp_service = pletyvo.DAppService.di(
    engine=engine,
)
dapp_service = pletyvo.DAppService(
    hash=pletyvo.HashService(...),
    event=pletyvo.EventService(...),
)

Cryptography: signing with dapp.AuthHeader

Most dApp calls that create or update data must be signed with an ED25519 keypair; read‑only requests work without it.

py‑pletyvo lets you obtain a keypair from a random seed, raw bytes, or a file. If you prefer BIP‑39 mnemonics, generate a seed with an external helper such as osyah/homin and load it into the signer.

from pletyvo import dapp

signer: dapp.abc.Signer

signer = dapp.ED25519.gen()
signer = dapp.ED25519.from_file(...)
signer = dapp.ED25519(...)

Pletyvo: decentralized applications (UA)

Delivery

Platform docs: Delivery

The delivery layer exposes three narrow services — pletyvo.ChannelService, pletyvo.PostService, and pletyvo.MessageService — bundled under pletyvo.DeliveryService.

import pletyvo

delivery_service = pletyvo.DeliveryService.di(
    engine=engine,
    signer=signer,
    event=event_service,
)
delivery_service = pletyvo.DeliveryService(
    channel=pletyvo.ChannelService(...),
    post=pletyvo.PostService(...),
    message=pletyvo.MessageService(...),
)

Metadata

Release files for pletyvo 0.1.0

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

Source distribution (sdist)

Source distribution for pletyvo 0.1.0
File Size Uploaded Provenance Actions
pletyvo-0.1.0.tar.gz 15.4 kB Without provenance Details for pletyvo-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 37.6 kB

Release files / pletyvo-0.1.0.tar.gz

Download URL pletyvo-0.1.0.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
028781d5d7f5da1e0bf699bd460b3b64e17fa4b4abbbe9ce0010eb48268e745c
BLAKE2b-256 checksum
How to use checksums
278d868f9b01bca4d28629ec5a9e0ac6bd87fcb5ab8a0a99df5d15d0081caf68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / pletyvo-0.1.0-py3-none-any.whl

Download URL pletyvo-0.1.0-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bebe83aa3be1829a83d0169439a62c7c59faf55098b643d8406f383aa7382c8d
BLAKE2b-256 checksum
How to use checksums
aa335e757e5b1376f11638b1512b932a2df20110260f5d0a870450eb30f18d3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Security for pletyvo 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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