A Python Interface for iMessage on MacOS
Project description
๐๐ฌ macpymessenger
macpymessenger is a Python library that provides a simple interface for sending iMessages on macOS. It allows you to send text messages programmatically using the Messages app on your Mac.
Features
Feature | Status |
---|---|
Send text messages | โ |
Check compatibility | โ |
Send images | โ |
Send attachments | โ |
Receive messages | โ |
Group messaging | โ |
Bulk messaging | โ |
Message history retrieval | โ |
Message status retrieval | โ |
๐ Installation
You can install macpymessenger using pip:
pip install macpymessenger
๐ง๐ฝโ๐ป Usage
Here's a simple example of how to use macpymessenger to send a text message:
from i_py_messenger import IMessageClient, Configuration
config = Configuration()
client = IMessageClient(config)
phone_number = "1234567890"
message = "Hello, this is a test message sent using macpymessenger!"
success = client.send(phone_number, message)
if success:
print("Message sent successfully!")
else:
print("Failed to send the message.")
โ๏ธ Configuration
The Configuration
class allows you to customize the paths to the AppleScript files used by macpymessenger. By default, it uses the following paths:
send_script_path
:osascript/sendMessage.scpt
check_compatibility_script_path
:osascript/checkCompatibility.scpt
You can modify these paths if needed by creating an instance of the Configuration
class and setting the desired paths.
๐งช Testing
macpymessenger includes a test suite to ensure the functionality of the library. To run the tests, make sure you have the required dependencies installed and execute the following command:
python -m pytest test.py
The tests cover the following scenarios:
- Sending a message successfully
- Initializing the
Configuration
class - Verifying the paths of the AppleScript files
๐ฆ Project Structure
macpymessenger/
โโโ i_py_messenger/
โ โโโ __init__.py
โ โโโ configuration.py
โ โโโ imessage_client.py
โ โโโ osascript/
โ โโโ sendMessage.scpt
โโโ .env.template
โโโ .github/
โ โโโ workflows/
โ โโโ python-publish.yml
โโโ LICENSE
โโโ README.md
โโโ requirements.txt
โโโ setup.py
โโโ test.py
๐ License
macpymessenger is licensed under the Apache License 2.0. See the LICENSE file for more information.
๐ค Contributing
Contributions to macpymessenger are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
๐ Acknowledgements
Originally forked from Rolstenhouse/py-iMessage, macpymessenger was inspired by the need for a simple and intuitive way to send iMessages using Python on macOS. Special thanks to the developers of the libraries and tools used in this project.
๐ง Contact
If you have any questions or inquiries, feel free to reach out to me:
- Email: e.t.wickstrom@wustl.edu
- GitHub: ethan-wickstrom
Thank you for using macpymessenger!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file macpymessenger-0.1.0.tar.gz
.
File metadata
- Download URL: macpymessenger-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf7dac7688d1163bd73e0633237d99285ea7579d26f04a36d5c9e86a54f3a076 |
|
MD5 | 790f897ba7ebb8139313c5b811573450 |
|
BLAKE2b-256 | 3c4a4d646ec6c03a0b52de9e7881745015ebb1a6dd4c2cb14636202585f24ca1 |
File details
Details for the file macpymessenger-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: macpymessenger-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7d8013737f84319e973e3c1e6b8c3ec6468c574b7af904e4be378a2f072384f |
|
MD5 | eabf4aa1a941faa16aa594346eabb89d |
|
BLAKE2b-256 | 631bbdf63076330b8db21bff9f644788942a7e7cf315b5991bda2cb37a7ad6b3 |