Skip to main content

Communication library and commands for mind-to-mind messaging

Project description

haiv-mail

Communication library and commands for mind-to-mind messaging in haiv communities.

Installation

pip install haiv-mail

Library Usage

from haiv_mail import Address, Message, Mailbox

# Connect to the shared mailbox
store = Mailbox(db_path=Path("~/.local/state/haiv/mail.db"))

# Send a message
msg = store.send(
    sender=Address.parse("仁@haiv-mail"),
    recipients=[Address.parse("luna@haiv")],
    subject="hello",
    body="First message.",
)

# Check inbox
messages = store.list_messages(Address.parse("luna@haiv"))

# Read a message (marks as read)
msg = store.read_message(Address.parse("luna@haiv"), message_id)

# Reply (domain operation)
from haiv_mail.domain import reply
reply(store, msg, sender=Address.parse("luna@haiv"), body="Got it.")

# Wait for new mail (blocks)
msg = store.wait(Address.parse("luna@haiv"), timeout=60)

Commands

haiv-mail ships commands for use with the haiv command system:

  • hv mail send — Send a message
  • hv mail reply <id> — Reply to a message
  • hv mail inbox — List messages (with unread markers)
  • hv mail read <id> — Read a message
  • hv mail delete <id> — Delete a message
  • hv mail sent — List sent messages
  • hv mail thread <id> — View a conversation
  • hv mail wait — Block until new mail arrives
  • hv mail who — Show minds currently waiting
  • hv mail contacts — List minds you've communicated with

Architecture

  • MailStore protocol — defines the data layer contract
  • Mailbox — SQLite implementation (WAL mode, concurrent-safe)
  • Domain functions — logic above the data layer (reply)
  • Commands — haiv CLI integration

License

MIT

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

haiv_mail-0.2.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

haiv_mail-0.2.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file haiv_mail-0.2.0.tar.gz.

File metadata

  • Download URL: haiv_mail-0.2.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for haiv_mail-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a4b5002eac6e2b7bb13a7e6cbf960416392169f1cab97e55cc4a0d71baca195e
MD5 4028d042cb032a65dff93222e2ab6b79
BLAKE2b-256 9cda21bf6b757bd6731bba75b26cf307d4f8e0997d7cd4603d32f4acfe3fb86c

See more details on using hashes here.

File details

Details for the file haiv_mail-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: haiv_mail-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for haiv_mail-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b59fd1810c1a8cb3ddf1f81d7f75a3fe568316dd0f038131cd6e9f0fccdc7b8
MD5 ec56ebf184f55049b101ad8dc0a06504
BLAKE2b-256 95a2a05e5969dacf58c157074782ee8fcc50ff9c443316be79ff8f78a07e1d36

See more details on using hashes here.

Supported by

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