# Mailsac Client Library
![Build Status](https://github.com/gsejas/mailsac-pyclient/actions/workflows/test-and-package.yml/badge.svg)
![PyPI Version](https://img.shields.io/pypi/v/pymailsac)
![License](https://img.shields.io/github/license/Gsejas/mailsac-pyclient)
![Python Version](https://img.shields.io/pypi/pyversions/pymailsac)
This is a Python client library for interacting with the Mailsac REST API. It provides a simple interface to receive, and manage emails using Mailsac's services. See full documentation for the API, here https://mailsac.com/docs/api/#section/About-the-API
## Features
- Retrieve messages from your Mailsac inbox.
- Delete messages from your inbox.
| **Category** | **Endpoint** | **Method** | **Description** | Implemented |
| ---------------------- | ---------------------------------------------------------- | ---------- | ------------------------------------------------------ | ----------- |
| **Email Messages API** | /addresses/{email}/message-count | GET | Count messages for an email inbox | No |
| | /addresses/{email}/messages | GET | List messages for an email inbox | Yes |
| | /addresses/{email}/messages | DELETE | Delete all messages for an email inbox | No |
| | /addresses/starred/messages | GET | List starred (saved) messages on the account | No |
| | /addresses/{email}/messages/{messageId} | GET | Get email message metadata | Yes |
| | /addresses/{email}/messages/{messageId} | DELETE | Delete an email message | Yes |
| | /raw/{email}/{messageId} | GET | Get original SMTP message | No |
| | /addresses/{email}/messages/{messageId}/headers | GET | Get parsed message headers | No |
| | /dirty/{email}/{messageId} | GET | Get message HTML body (dirty) | No |
| | /body/{email}/{messageId} | GET | Get message HTML body (sanitized) | No |
| | /text/{email}/{messageId} | GET | Get message plaintext | Yes |
| | /addresses/{email}/messages/{messageId}/star | PUT | Star (save) a message | No |
| | /addresses/{email}/messages/{messageId}/labels/{label} | PUT | Add a label to a message | No |
| | /addresses/{email}/messages/{messageId}/labels/{label} | DELETE | Remove a label from a message | No |
| | /addresses/{email}/messages/{messageId}/folder/{folder} | PUT | Move a message into a folder | No |
| | /addresses/{email}/messages/{messageId}/read/{readBoolean} | PUT | Set message read/unread status | No |
| | /inbox | GET | Get all account messages paginated | No |
| | /inbox-filter | GET | Filter messages in account by to, from, and/or subject | No |
| | /inbox-search | GET | Search messages by to, from, and subject | No |
| | /domains/{domain}/messages | GET | List messages for a domain | No |
| | /domains/{domain}/delete-all-domain-mail | POST | Delete all messages in a domain | No |
## Installation
To install the Mailsac client library, you can use pip:
```
pip install pymailsac
```
## Usage
Here is a basic example of how to use the MailsacClient:
```python
from pymailsac.client import MailsacClient
# Initialize the client
client = MailsacClient(api_key='your_api_key')
# Get messages
messages = client.get_messages('your_inbox_id')
# Delete a message
client.delete_message('your_inbox_id', 'message_id')
```
## Client Initialization
```mermaid
sequenceDiagram
participant User
participant MailsacClient
User->>MailsacClient: Initialize with API key
MailsacClient-->>User: Client instance created
```
## Fetching Messages
```mermaid
sequenceDiagram
participant User
participant MailsacClient
participant MailsacAPI
User->>MailsacClient: get_messages(email)
MailsacClient->>MailsacAPI: GET /addresses/{email}/messages
MailsacAPI-->>MailsacClient: JSON response with messages
MailsacClient-->>User: List of EmailMessage instances
```
## Deleting a Message
```mermaid
sequenceDiagram
participant User
participant MailsacClient
participant MailsacAPI
User->>MailsacClient: delete_message(email, message_id)
MailsacClient->>MailsacAPI: DELETE /addresses/{email}/messages/{message_id}
MailsacAPI-->>MailsacClient: Success response
MailsacClient-->>User: True
```
## Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bugs.
## License
This project is licensed under the MIT License. See the LICENSE file for more details.
Raw data
{
"_id": null,
"home_page": "https://github.com/GSejas/mailsac-pyclient",
"name": "pymailsac",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "mailsac, api, wrapper, client",
"author": "GSejas",
"author_email": "jsequeira03@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/81/ff/ebf3d53e6f695fe30f47fb64c723e19ac0e28e9e5ceb79a78b6bd5f6a55b/pymailsac-0.1.4.tar.gz",
"platform": null,
"description": "# Mailsac Client Library\n\n![Build Status](https://github.com/gsejas/mailsac-pyclient/actions/workflows/test-and-package.yml/badge.svg)\n![PyPI Version](https://img.shields.io/pypi/v/pymailsac)\n![License](https://img.shields.io/github/license/Gsejas/mailsac-pyclient)\n![Python Version](https://img.shields.io/pypi/pyversions/pymailsac)\n\nThis is a Python client library for interacting with the Mailsac REST API. It provides a simple interface to receive, and manage emails using Mailsac's services. See full documentation for the API, here https://mailsac.com/docs/api/#section/About-the-API\n\n## Features\n\n- Retrieve messages from your Mailsac inbox.\n- Delete messages from your inbox.\n\n\n| **Category** | **Endpoint** | **Method** | **Description** | Implemented |\n| ---------------------- | ---------------------------------------------------------- | ---------- | ------------------------------------------------------ | ----------- |\n| **Email Messages API** | /addresses/{email}/message-count | GET | Count messages for an email inbox | No |\n| | /addresses/{email}/messages | GET | List messages for an email inbox | Yes |\n| | /addresses/{email}/messages | DELETE | Delete all messages for an email inbox | No |\n| | /addresses/starred/messages | GET | List starred (saved) messages on the account | No |\n| | /addresses/{email}/messages/{messageId} | GET | Get email message metadata | Yes |\n| | /addresses/{email}/messages/{messageId} | DELETE | Delete an email message | Yes |\n| | /raw/{email}/{messageId} | GET | Get original SMTP message | No |\n| | /addresses/{email}/messages/{messageId}/headers | GET | Get parsed message headers | No |\n| | /dirty/{email}/{messageId} | GET | Get message HTML body (dirty) | No |\n| | /body/{email}/{messageId} | GET | Get message HTML body (sanitized) | No |\n| | /text/{email}/{messageId} | GET | Get message plaintext | Yes |\n| | /addresses/{email}/messages/{messageId}/star | PUT | Star (save) a message | No |\n| | /addresses/{email}/messages/{messageId}/labels/{label} | PUT | Add a label to a message | No |\n| | /addresses/{email}/messages/{messageId}/labels/{label} | DELETE | Remove a label from a message | No |\n| | /addresses/{email}/messages/{messageId}/folder/{folder} | PUT | Move a message into a folder | No |\n| | /addresses/{email}/messages/{messageId}/read/{readBoolean} | PUT | Set message read/unread status | No |\n| | /inbox | GET | Get all account messages paginated | No |\n| | /inbox-filter | GET | Filter messages in account by to, from, and/or subject | No |\n| | /inbox-search | GET | Search messages by to, from, and subject | No |\n| | /domains/{domain}/messages | GET | List messages for a domain | No |\n| | /domains/{domain}/delete-all-domain-mail | POST | Delete all messages in a domain | No |\n\n## Installation\n\nTo install the Mailsac client library, you can use pip:\n\n```\npip install pymailsac\n```\n\n## Usage\n\nHere is a basic example of how to use the MailsacClient:\n\n```python\nfrom pymailsac.client import MailsacClient\n\n# Initialize the client\nclient = MailsacClient(api_key='your_api_key')\n\n# Get messages\nmessages = client.get_messages('your_inbox_id')\n\n# Delete a message\nclient.delete_message('your_inbox_id', 'message_id')\n```\n\n## Client Initialization\n\n```mermaid\nsequenceDiagram\n participant User\n participant MailsacClient\n User->>MailsacClient: Initialize with API key\n MailsacClient-->>User: Client instance created\n```\n\n## Fetching Messages\n\n```mermaid\nsequenceDiagram\n participant User\n participant MailsacClient\n participant MailsacAPI\n User->>MailsacClient: get_messages(email)\n MailsacClient->>MailsacAPI: GET /addresses/{email}/messages\n MailsacAPI-->>MailsacClient: JSON response with messages\n MailsacClient-->>User: List of EmailMessage instances\n```\n\n## Deleting a Message\n\n```mermaid\nsequenceDiagram\n participant User\n participant MailsacClient\n participant MailsacAPI\n User->>MailsacClient: delete_message(email, message_id)\n MailsacClient->>MailsacAPI: DELETE /addresses/{email}/messages/{message_id}\n MailsacAPI-->>MailsacClient: Success response\n MailsacClient-->>User: True\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bugs.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "API Wrapper Client for Mailsac",
"version": "0.1.4",
"project_urls": {
"Documentation": "https://github.com/GSejas/mailsac-pyclient/blob/master/README.md",
"Homepage": "https://github.com/GSejas/mailsac-pyclient",
"Repository": "https://github.com/GSejas/mailsac-pyclient"
},
"split_keywords": [
"mailsac",
" api",
" wrapper",
" client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4bce47d08add93ad9e6b75dda1755e39360c4cb0bfb7a173915a99ad2dbca747",
"md5": "86f4f0e301e3859209555b41cb932b6e",
"sha256": "bb44480cf0f44a01ba016a983123d489ce0d98c3c692940fe38829531e982e4b"
},
"downloads": -1,
"filename": "pymailsac-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "86f4f0e301e3859209555b41cb932b6e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 6120,
"upload_time": "2024-11-18T08:41:34",
"upload_time_iso_8601": "2024-11-18T08:41:34.785737Z",
"url": "https://files.pythonhosted.org/packages/4b/ce/47d08add93ad9e6b75dda1755e39360c4cb0bfb7a173915a99ad2dbca747/pymailsac-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "81ffebf3d53e6f695fe30f47fb64c723e19ac0e28e9e5ceb79a78b6bd5f6a55b",
"md5": "4141ebc1e1cfb10bbbae9e8f528ed8d6",
"sha256": "e6f479c8ff7bb23eb635e2334b1017aa90dac9311eee79b1b6a698a95f560ca7"
},
"downloads": -1,
"filename": "pymailsac-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "4141ebc1e1cfb10bbbae9e8f528ed8d6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 5266,
"upload_time": "2024-11-18T08:41:36",
"upload_time_iso_8601": "2024-11-18T08:41:36.500877Z",
"url": "https://files.pythonhosted.org/packages/81/ff/ebf3d53e6f695fe30f47fb64c723e19ac0e28e9e5ceb79a78b6bd5f6a55b/pymailsac-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 08:41:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GSejas",
"github_project": "mailsac-pyclient",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pymailsac"
}