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 messagehv mail reply <id>— Reply to a messagehv mail inbox— List messages (with unread markers)hv mail read <id>— Read a messagehv mail delete <id>— Delete a messagehv mail sent— List sent messageshv mail thread <id>— View a conversationhv mail wait— Block until new mail arriveshv mail who— Show minds currently waitinghv 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.1.tar.gz
(29.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
haiv_mail-0.2.1-py3-none-any.whl
(22.7 kB
view details)
File details
Details for the file haiv_mail-0.2.1.tar.gz.
File metadata
- Download URL: haiv_mail-0.2.1.tar.gz
- Upload date:
- Size: 29.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a38184d5d92e4d66786a18d4df11e4382526b1a848905d6251f530fb8231024
|
|
| MD5 |
7159e0df230483c8d401648aa5383945
|
|
| BLAKE2b-256 |
0cd3c1fe2d05b292f81db6c4715b4f21db9c8205ee0825038e2a3821a238a360
|
File details
Details for the file haiv_mail-0.2.1-py3-none-any.whl.
File metadata
- Download URL: haiv_mail-0.2.1-py3-none-any.whl
- Upload date:
- Size: 22.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aca22091f31455d93b26de99cc5dfe25211634867e18b7e3431e3e1babaa1845
|
|
| MD5 |
7436bf0bf6ead8b81a846963689f01b4
|
|
| BLAKE2b-256 |
8732463ab93db0e3b087c4d3b89b9921e8312fd45845430c9010ca0a33cf1cc2
|