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

Uploaded Source

Built Distribution

aleph_message-0.1.6-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aleph-message-0.1.6.tar.gz
Algorithm Hash digest
SHA256 285fc5fc3557b65802af382815f12615464d4d23b8b41e15fbaccdb648b230e6
MD5 6ae116b7500e94f229a62a55858ca21c
BLAKE2b-256 c19864e8a480146edfe31eb48be60918e2a82948fa91cea9a69efe6ed6cf79a0

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for aleph_message-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ec54fc12bdc892cc7f62626a979ad64c60280ea6c6b3a2925567464f38b8534c
MD5 11ede82ee1fa2ef229b11d4ab0544e46
BLAKE2b-256 85b74c4e79a8f2f788499e3c597cc8165a5c99366145e3a917c18c29a90d4e2d

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