Skip to main content

Aleph.im Message Specification

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

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

This library provides:

  • schema validation when parsing messages.
  • cryptographic hash validation that the item_hash matches the content of the message.
  • type validation using type checkers such as mypy in development environments.
  • autocompletion support in development editors.

The item_hash is commonly used as unique message identifier on Aleph.im.

Cryptographic signatures are out of scope of this library and part of the aleph-sdk-python project, due to their extended scope and dependency on cryptographic libraries.

This library is used in both client and node software of Aleph.im.

Usage

pip install aleph-message
import requests
from aleph_message import parse_message
from pydantic import ValidationError

ALEPH_API_SERVER = "https://official.aleph.cloud"
MESSAGE_ITEM_HASH = "9b21eb870d01bf64d23e1d4475e342c8f958fcd544adc37db07d8281da070b00"

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

try:
    message = parse_message(message_dict["messages"][0])
    print(message.sender)
except ValidationError as e:
    print(e.json(indent=4))

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aleph_message-1.5.0-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

Details for the file aleph_message-1.5.0.tar.gz.

File metadata

  • Download URL: aleph_message-1.5.0.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aleph_message-1.5.0.tar.gz
Algorithm Hash digest
SHA256 e88aefff641f10fd2a83439592ccc733b674a0a63b8f87135bfca36988eade63
MD5 dc5ef2a2be5944465b2637dac0afc2e3
BLAKE2b-256 4961432ccb19f5d9e8f5f966d3264b63947e66073efdc198d3d63dfa12cf4dea

See more details on using hashes here.

Provenance

The following attestation bundles were made for aleph_message-1.5.0.tar.gz:

Publisher: publish.yml on aleph-im/aleph-message

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: aleph_message-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 64.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aleph_message-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91e90d6996edc662d2a3bb906c8ad4b28332f30ccdc5d54f3ebdb958ccdc49f4
MD5 6a9bd99375c3f3ad9494c586f6713eac
BLAKE2b-256 972fce998885401084bdd4e636e0867bfbddc2432111816d40492226d7770788

See more details on using hashes here.

Provenance

The following attestation bundles were made for aleph_message-1.5.0-py3-none-any.whl:

Publisher: publish.yml on aleph-im/aleph-message

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

1 file

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page