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

Uploaded Source

Built Distribution

aleph_message-0.1.12-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aleph-message-0.1.12.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for aleph-message-0.1.12.tar.gz
Algorithm Hash digest
SHA256 715f56e4fb92b7522b47b03349aaa664ddd08537e45beb99fce2d7aab5731cf8
MD5 b60f7c797ab9b1747b62673202ec8bf1
BLAKE2b-256 ff07abd1ae9cb1a723142ba0f3c51a7d95881eb28fb665fc5182d07b32f22659

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: aleph_message-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for aleph_message-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 817b7178343ce9f87f6fdac44c0932b654ec8df5ea2f4d66456ec67cfb920076
MD5 85acfe9d4598ddcbf904a87a6c79bc2c
BLAKE2b-256 67d3f70956ab61425997b74646399275ee10a3002a0c9299eaf42c19889edb5b

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