Skip to main content

Lusid

If you have the following:

  • Macbook
  • Python

You can programatically control iMessage, here's how

Quickstart

  1. Install the dependency
$ pip install lusid
$ # Or pipenv install lusid...
  1. Create a "client" to repeatedly read your inbox (the rest of this quickstart assumes you're writing to a file named app.py but feel free to replace that later on with whatever you named your to)
# app.py

from lusid import create_simple_message_reader

def start_client():
  create_simple_message_reader(
    message_handler=lambda to, body: None
  )

if __name__ == "__main__":
  start_client()
  1. Define a function for handling messages:
# Snippet

def handle_message(from, body, send_message):
  print(f"Handling the message [{body}] from [{from}]")
  send_message(from, "Some funny autoreply here")

Similar to a "response" variable in web handlers, the send_message parameter provides a method to send a message

  1. Next we're going to include the function we defined earlier
# app.py

from lusid import create_simple_message_reader

+def handle_message(from, body, send_message):
+  print(f"Handling the message [{body}] from [{from}]")
+  send_message(from, "Some funny autoreply here")

def start_client():
  create_simple_message_reader(
    message_handler=lambda to, body: None
  )

if __name__ == "__main__":
  start_client()

Then actually use it as our message handler

# app.py

from lusid import create_simple_message_reader

def handle_message(from, body, send_message):
  print(f"Handling the message [{body}] from [{from}]")
  send_message(from, "Some funny autoreply here")

def start_client():
  create_simple_message_reader(
-    message_handler=lambda to, body: None
+    message_handler=handle_message
  )

if __name__ == "__main__":
  start_client()
  1. Now your script is set up to automatically reply to every received message with "Some funny autoreply here"
$ python app.py
Some terminal output indicating it's running...

Additional methods

Architecture

If you're wondering how this works under the hood there are two components:

  1. Reading messages
  2. Sending messages

Metadata

Release files for lusid-yevbarkalov 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lusid-yevbarkalov 0.0.1
File Size Uploaded Provenance
lusid_yevbarkalov-0.0.1.tar.gz 2.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lusid-yevbarkalov 0.0.1
File Interpreter ABI Platform
lusid_yevbarkalov-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 kB

Release files / lusid_yevbarkalov-0.0.1.tar.gz

Download URL lusid_yevbarkalov-0.0.1.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9976dc6a6715edde09d91b8fbd0ce1e79d3c0f47657cb51ef964f899e5a20641
BLAKE2b-256 checksum
How to use checksums
4a58147b6de3c9cfa84a80bd3016cb7896a6897dc0191c225054cd3d7f66aaaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / lusid_yevbarkalov-0.0.1-py3-none-any.whl

Download URL lusid_yevbarkalov-0.0.1-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e552a491a2a163f2f45d1c714f9de88b1e5870d724961d9b5f849b716766d95
BLAKE2b-256 checksum
How to use checksums
7641bd837497064e19a534343c7d4cb2eb6e89c181d5330fa0676ed9d5e323b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for lusid-yevbarkalov 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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