Skip to main content

Sync-first Python API for local macOS Messages and Contacts

Project description

imessage-wrapper

imessage-wrapper is a sync-first Python package for reading local macOS Messages history, enriching it with macOS Contacts, sending through Messages.app, and creating/updating Contacts records through Apple's Contacts framework.

Install

pip install imessage-wrapper

Install the optional Contacts write dependency on macOS with:

pip install "imessage-wrapper[contacts]"

Usage

from imessage_wrapper import IMessageClient

client = IMessageClient()

for chat in client.chats(limit=10):
    print(chat.id, chat.name, chat.last_message_at)

messages = client.messages(chat_id=chat.id, limit=50, attachments=True)
client.send(chat_id=chat.id, text="hello")

Permissions

Reads require Full Disk Access for the Python process so it can open ~/Library/Messages/chat.db and the AddressBook databases. Sending requires Automation permission to control Messages.app. Contact writes require Contacts permission and the pyobjc-framework-Contacts dependency on macOS.

The package reads Messages and AddressBook SQLite databases in read-only mode. It never writes those databases directly.

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

imessage_wrapper-0.1.0.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

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

imessage_wrapper-0.1.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file imessage_wrapper-0.1.0.tar.gz.

File metadata

  • Download URL: imessage_wrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for imessage_wrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 287d199d240a92845f57ce4d55f2aaa96b18a9244bd8b9cdaa63a0efa3567dd3
MD5 2e40e9dfcc2b3e31aac09af96b0ff09b
BLAKE2b-256 45633253a141501c63373adde30ac333281277460a5c93cfd384c12fa6e6ddf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for imessage_wrapper-0.1.0.tar.gz:

Publisher: publish.yml on kylevedder/imessage-wrapper

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

File details

Details for the file imessage_wrapper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for imessage_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26542ecf84861a1f06331f2badd1d0a9d2a10dce4ce3126c564a379bd1fa851f
MD5 89f9e9f53229b4bf190ec03f511a534c
BLAKE2b-256 93a03ce70a173e1d4872413a52c1c9f172cb9de9278ca3b8693609475c7fdfc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for imessage_wrapper-0.1.0-py3-none-any.whl:

Publisher: publish.yml on kylevedder/imessage-wrapper

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

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