A modern Python SDK for generating dynamic JSON interfaces
Project description
JSONApp Python SDK
Note: This is the Python port of the JSONApp 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 JSONApp SDK.
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 City-Mate 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 JsonApp, JsonAppConfig
from yeriasdk.views import FormView
# Initialize JsonApp
config = JsonAppConfig(
app_id="my-app",
view_expiration_minutes=60,
)
app = JsonApp(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
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()(orset_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, JsonApp)
✅ All 12 view types
✅ Type definitions
✅ Error handling
✅ Validation utilities
✅ Ed25519 signing/verification
✅ Examples
License
Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 yeriasdk-1.0.0.tar.gz.
File metadata
- Download URL: yeriasdk-1.0.0.tar.gz
- Upload date:
- Size: 51.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1139a5815dc027eb389a4034cabe86c023b1cac184cb8df6ed409aeb03572d71
|
|
| MD5 |
005b4413b3147090fca80eb7106e7a45
|
|
| BLAKE2b-256 |
983a8b1cd55efdb3340525e213921c8c813c5bde8dde353dae4d4cc19f1bb11f
|
File details
Details for the file yeriasdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: yeriasdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 58.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e53c84a24d7b870508e13468649053483c4ab799ca5944972ba37bbb16fc09f3
|
|
| MD5 |
f8049ef7f3cbb9d409088d5a1a4b812d
|
|
| BLAKE2b-256 |
a5f328869ba4c15c6514dd2a408771f031cdfd28eff15d96b9cda438da692410
|