Skip to main content

Aleph.im message specification

Project description

Aleph.im Message Specification

This library aims to provide an easy way to create, update and validate messages from Aleph.im.

It mainly consists in pydantic models that provide field type validation and IDE autocompletion for messages.

Status

Currently, only basic type validation is included. Advanced data and signature validation is not included.

In the future, this library would be useful within other projects such as the client library aleph-client.

Usage

import requests
from aleph_message import Message
from pydantic import ValidationError

message_dict = requests.get(ALEPH_API_SERVER + "/api/v0/messages.json?hashes=...").json()

try:
    message = Message(**message_dict)
    print(message.sender)
except ValidationError as e:
    print(e.json())

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

aleph-message-0.1.19.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

aleph_message-0.1.19-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file aleph-message-0.1.19.tar.gz.

File metadata

  • Download URL: aleph-message-0.1.19.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.10

File hashes

Hashes for aleph-message-0.1.19.tar.gz
Algorithm Hash digest
SHA256 76aa80311cb26273a58ebf8c0e30e8ab86b9c13dcc1cad2d0b5625abd028dc4c
MD5 bc7e92ec4299124122f27a7f17ddab7d
BLAKE2b-256 03817af132097c1db5dc6b8a23755a02cbf50b2075322a0ff039d43d60256849

See more details on using hashes here.

Provenance

File details

Details for the file aleph_message-0.1.19-py3-none-any.whl.

File metadata

File hashes

Hashes for aleph_message-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 86f527a206f8959d836efed4ad6d8525fc446f709ad758aa901a59e27b1c938f
MD5 3f2fa45683f57cd294372d7698c8b78c
BLAKE2b-256 24cbe36e17b07687460407d59c1a51752f74d0c1a5afd515d13820b1d96fbce5

See more details on using hashes here.

Provenance

Supported by

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