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.2.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

aleph_message-0.2.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aleph-message-0.2.2.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for aleph-message-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1c00ab563cb7537bc2851a241007a6aa0bf5538a561b288b4a5a361d02af5a36
MD5 96969522cad26e7c8ebc467b6dc2ec61
BLAKE2b-256 40f282cd909a4f3b8ec08eb6a38adfe65a24a3b6edb720ef0015ecc0b80748b7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for aleph_message-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 64af50e1fb6ebfb5d85c8d41f487187304ce91bc446e9515d115789df354e014
MD5 cf6cb2ed18d3225c85071c8769c24143
BLAKE2b-256 b1e34ebf0d778ae0264ddfc8e61609b0555f46c4842d3a6dcdc5b37308512451

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