Skip to main content

A modern Python SDK for generating dynamic JSON interfaces

Project description

Yeria Python SDK

Note: This is the Python port of the Yeria SDK. This repository is a monorepo containing multiple language implementations. See the root README for an overview.

A stateless backend library for building views that are sent to renderers (mobile or web). This is the Python port of the TypeScript Yeria SDK.

🌐 Website: yeria.app

Features

  • Stateless Architecture: No internal state, perfect for serverless and microservices
  • Ed25519 Signing: Secure view signing and verification using Ed25519 cryptography
  • 12 View Types: Form, Reader, ActionList, ActionGrid, QRScan, QRDisplay, Message, Card, Carousel, Timeline, Media, Map
  • Notifications: Send signed notifications to users via the Yeria platform
  • Type Safety: Full type definitions using Python dataclasses and type hints
  • Validation: Built-in field and form validation
  • Security: XSS protection, URL validation, input sanitization

Installation

pip install yeriasdk

Quick Start

from yeriasdk import YeriaApp, YeriaAppConfig
from yeriasdk.views import FormView

# Initialize YeriaApp
config = YeriaAppConfig(
    app_id="my-app",
    view_expiration_minutes=60,
)
app = YeriaApp(config)

# Create a form view
form = app.create_form_view("registration", "User Registration")
form.add_text_field("name", "Full Name", is_required=True)
form.add_email_field("email", "Email", is_required=True)
form.submit_button("Register")

# Serve with signature
response = app.serve(form)
print(response.view)  # The view JSON
print(response.signature)  # Ed25519 signature

Static JSON Views

from yeriasdk import YeriaApp, YeriaAppConfig

app = YeriaApp(YeriaAppConfig(app_id="my-app"))

envelope = app.serve_raw_view(
    {
        "id": "home-static",
        "type": "Reader",
        "content": {
            "title": "Bienvenue",
            "body": [
                {"type": "paragraph", "text": "Cette vue vient d'un bloc JSON."}
            ],
        },
    }
)
print(envelope.payload)
print(envelope.signature)

View Types

FormView

Create forms with various field types (text, email, password, select, file, GPS, etc.)

ReaderView

Display rich content with paragraphs, images, markdown, tables, code blocks, etc.

ActionListView / ActionGridView

Display lists or grids of actions

QRScanView / QRDisplayView

QR code scanning and display

MessageView

Display messages with actions

CardView

Display card-based content with stats and sections

CarouselView

Display carousel slides

TimelineView

Display chronological events

MediaView

Display audio and video playlists

MapView

Display geographic data on maps

API Parity

The Python SDK maintains API parity with the TypeScript version:

  • Same factory methods: app.create_form_view(), app.create_reader_view(), etc.
  • Same fluent API: view.add_field().set_intro().submit_button() (or set_note() for backward compatibility)
  • Same validation and security features
  • Same Ed25519 signing and verification

Examples

See examples/basic_usage.py for a complete example.

Requirements

  • Python 3.10+
  • cryptography (for Ed25519)
  • markdown (for ReaderView markdown support)
  • bleach (for HTML sanitization)
  • requests (for sending notifications)

Status

✅ Core classes (BaseView, YeriaApp)
✅ All 12 view types
✅ Type definitions
✅ Error handling
✅ Validation utilities
✅ Ed25519 signing/verification
✅ Examples

License

Ce projet est sous licence Apache 2.0. Voir les fichiers LICENSE et NOTICE pour plus de détails. Copyright 2026 Numerum.

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

yeriasdk-1.2.0.tar.gz (71.5 kB view details)

Uploaded Source

Built Distribution

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

yeriasdk-1.2.0-py3-none-any.whl (84.3 kB view details)

Uploaded Python 3

File details

Details for the file yeriasdk-1.2.0.tar.gz.

File metadata

  • Download URL: yeriasdk-1.2.0.tar.gz
  • Upload date:
  • Size: 71.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for yeriasdk-1.2.0.tar.gz
Algorithm Hash digest
SHA256 60c8988a8f56599b774c2353efd75abad25ffe02f2553473eda6332dbaf3d13f
MD5 79ec35afd3a86245e5026cd8da16f5ba
BLAKE2b-256 b43169e94d0a477b35d1320fe9a048ef3bacde3bb1b8f5fa73d127cad28a3953

See more details on using hashes here.

File details

Details for the file yeriasdk-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: yeriasdk-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 84.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for yeriasdk-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f224689171448c1b4950416f7982d285ae89d2a2e9896bd7aed255abde2dc8d7
MD5 77f9babb5bc776a05b87cc18e4ee1062
BLAKE2b-256 d551509bbe7409bacb32feb121735e417693ef835f8df93507d4b13847d39dc3

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