mepost-python-sdk
=================
The `mepost-sdk` is a Python library designed to simplify interactions with the Mepost API. It provides convenient methods to send and manage messages efficiently. This SDK is ideal for developers looking to integrate Mepost messaging capabilities into their Python applications.
Features
--------
- Send emails directly through the Mepost API.
- Schedule and manage email deliveries.
- Retrieve detailed information about scheduled messages.
- Cancel scheduled messages.
- Send emails using predefined templates.
Installation
------------
Install `mepost-sdk` using pip:
```bash
pip install mepost-sdk
```
Usage
-----
Here is a quick example to get you started:
```python
from mepost import MepostClient
# Create an instance of MepostClient with your API key
client = MepostClient('your_api_key_here')
# Send an email
email_data = {
"from_email": "info@example.com",
"from_name": "Example Company",
"html": "This is a test email sent from the Mepost Python SDK.",
"subject": "Example Subject",
"to": [
{ "email": "recipient1@example.com" },
{ "email": "recipient2@example.com" }
]
}
response = client.send_email(email_data)
print(response)
```
API Methods
-----------
### `MepostClient(api_key)`
Initializes and returns a new instance of MepostClient.
- Parameters
- `api_key`: Your Mepost API key.
### Company Endpoints
#### `add_domain(request: AddDomainRequest)`
Adds a domain to the Mepost account.
- Parameters
- `request`: An object containing the domain to add.
#### `get_domain_list()`
Retrieves a list of domains associated with the Mepost account.
- No parameters.
#### `remove_domain(request: RemoveDomainRequest)`
Removes a domain from the Mepost account.
- Parameters
- `request`: An object containing the domain to remove.
### Groups Endpoints
#### `list_groups(limit: int = 10, page: int = 1)`
Retrieves a list of email groups.
- Parameters
- `limit`: The maximum number of groups to return (default: 10).
- `page`: The page number for pagination (default: 1).
#### `create_group(request: CreateNewGroupRequest)`
Creates a new email group.
- Parameters
- `request`: An object containing the details of the new group.
#### `delete_group(group_id: str)`
Deletes an email group.
- Parameters
- `group_id`: The ID of the group to delete.
#### `get_group_by_id(group_id: str)`
Retrieves information about a specific email group.
- Parameters
- `group_id`: The ID of the group to retrieve.
#### `update_group(group_id: str, request: RenameGroupRequest)`
Updates the name of an email group.
- Parameters
- `group_id`: The ID of the group to update.
- `request`: An object containing the new group name.
### Subscribers Endpoints
#### `list_subscribers(group_id: str, limit: int = 10, page: int = 1)`
Retrieves a list of subscribers in a group.
- Parameters
- `group_id`: The ID of the group.
- `limit`: The maximum number of subscribers to return (default: 10).
- `page`: The page number for pagination (default: 1).
#### `add_subscriber(group_id: str, request: CreateSubscriberRequest)`
Adds a subscriber to a group.
- Parameters
- `group_id`: The ID of the group.
- `request`: An object containing subscriber details.
#### `delete_subscriber(group_id: str, request: DeleteSubscriberRequest)`
Deletes a subscriber from a group.
- Parameters
- `group_id`: The ID of the group.
- `request`: An object containing the emails of subscribers to delete.
#### `get_subscriber_by_email(group_id: str, email: str)`
Retrieves subscriber details by email.
- Parameters
- `group_id`: The ID of the group.
- `email`: The email address of the subscriber.
### Messages Endpoints
#### `get_message_info(schedule_id: str, email: str)`
Retrieves information about a specific scheduled message.
- Parameters
- `schedule_id`: The ID of the scheduled message.
- `email`: The email address to which the message was sent.
#### `cancel_scheduled_message(request: CancelScheduledMessageRequest)`
Cancels a scheduled message.
- Parameters
- `request`: An object containing the scheduled message ID.
#### `send_marketing(request: SendMarketingRequest)`
Sends a marketing email.
- Parameters
- `request`: An object for sending marketing emails.
#### `send_message_by_template(request: SendMessageByTemplateRequest)`
Sends an email using a template.
- Parameters
- `request`: An object containing the message details and template ID.
#### `get_schedule_info(schedule_id: str)`
Retrieves schedule information for a specific scheduled message.
- Parameters
- `schedule_id`: The ID of the scheduled message.
#### `send_transactional(request: SendTransactionalRequest)`
Sends a transactional email.
- Parameters
- `request`: An object for sending transactional emails.
#### `send_transactional_by_template(request: SendMessageByTemplateRequest)`
Sends a transactional email using a template.
- Parameters
- `request`: An object containing the message details and template ID.
### Outbound IP Endpoints
#### `create_ip_group(request: CreateIpGroupRequest)`
Creates a new IP group.
- Parameters
- `request`: An object containing the IP group details.
#### `get_ip_group_info(name: str)`
Retrieves information about a specific IP group.
- Parameters
- `name`: The name of the IP group.
#### `list_ip_groups()`
Retrieves a list of all IP groups.
- No parameters.
#### `cancel_warmup(request: CancelWarmUpRequest)`
Cancels a warmup process for an IP address.
- Parameters
- `request`: An object containing the IP address.
#### `get_ip_info(ip: str)`
Retrieves information about a specific IP address.
- Parameters
- `ip`: The IP address to retrieve.
#### `list_ips()`
Retrieves a list of all IP addresses.
- No parameters.
#### `set_ip_group(request: SetIpGroupRequest)`
Assigns an IP address to a specific IP group.
- Parameters
- `request`: An object containing the IP address and group details.
#### `start_warmup(request: StartWarmUpRequest)`
Starts a warmup process for an IP address.
- Parameters
- `request`: An object containing the IP address.
Contributing
------------
Contributions are always welcome! Please read the contributing guide for ways to contribute to this project.
License
-------
`mepost-sdk` is released under the MIT License. See the LICENSE file for more details.
Raw data
{
"_id": null,
"home_page": "https://github.com/mepost-io/python-sdk",
"name": "mepost-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "mepost, email, sdk, api",
"author": "mepost",
"author_email": "info@mepost.io",
"download_url": "https://files.pythonhosted.org/packages/04/a1/97580e75813b33dbc35a32d0605d37c6049e984d43f0da7b47f13aeba04d/mepost_sdk-1.0.5.tar.gz",
"platform": null,
"description": "\nmepost-python-sdk\n=================\n\nThe `mepost-sdk` is a Python library designed to simplify interactions with the Mepost API. It provides convenient methods to send and manage messages efficiently. This SDK is ideal for developers looking to integrate Mepost messaging capabilities into their Python applications.\n\nFeatures\n--------\n\n- Send emails directly through the Mepost API.\n- Schedule and manage email deliveries.\n- Retrieve detailed information about scheduled messages.\n- Cancel scheduled messages.\n- Send emails using predefined templates.\n\nInstallation\n------------\n\nInstall `mepost-sdk` using pip:\n\n```bash\npip install mepost-sdk\n```\n\nUsage\n-----\n\nHere is a quick example to get you started:\n\n```python\nfrom mepost import MepostClient\n\n# Create an instance of MepostClient with your API key\nclient = MepostClient('your_api_key_here')\n\n# Send an email\nemail_data = {\n \"from_email\": \"info@example.com\",\n \"from_name\": \"Example Company\",\n \"html\": \"This is a test email sent from the Mepost Python SDK.\",\n \"subject\": \"Example Subject\",\n \"to\": [\n { \"email\": \"recipient1@example.com\" },\n { \"email\": \"recipient2@example.com\" }\n ]\n}\n\nresponse = client.send_email(email_data)\nprint(response)\n```\n\nAPI Methods\n-----------\n\n### `MepostClient(api_key)`\n\nInitializes and returns a new instance of MepostClient.\n\n- Parameters\n - `api_key`: Your Mepost API key.\n\n### Company Endpoints\n\n#### `add_domain(request: AddDomainRequest)`\n\nAdds a domain to the Mepost account.\n\n- Parameters\n - `request`: An object containing the domain to add.\n\n#### `get_domain_list()`\n\nRetrieves a list of domains associated with the Mepost account.\n\n- No parameters.\n\n#### `remove_domain(request: RemoveDomainRequest)`\n\nRemoves a domain from the Mepost account.\n\n- Parameters\n - `request`: An object containing the domain to remove.\n\n### Groups Endpoints\n\n#### `list_groups(limit: int = 10, page: int = 1)`\n\nRetrieves a list of email groups.\n\n- Parameters\n - `limit`: The maximum number of groups to return (default: 10).\n - `page`: The page number for pagination (default: 1).\n\n#### `create_group(request: CreateNewGroupRequest)`\n\nCreates a new email group.\n\n- Parameters\n - `request`: An object containing the details of the new group.\n\n#### `delete_group(group_id: str)`\n\nDeletes an email group.\n\n- Parameters\n - `group_id`: The ID of the group to delete.\n\n#### `get_group_by_id(group_id: str)`\n\nRetrieves information about a specific email group.\n\n- Parameters\n - `group_id`: The ID of the group to retrieve.\n\n#### `update_group(group_id: str, request: RenameGroupRequest)`\n\nUpdates the name of an email group.\n\n- Parameters\n - `group_id`: The ID of the group to update.\n - `request`: An object containing the new group name.\n\n### Subscribers Endpoints\n\n#### `list_subscribers(group_id: str, limit: int = 10, page: int = 1)`\n\nRetrieves a list of subscribers in a group.\n\n- Parameters\n - `group_id`: The ID of the group.\n - `limit`: The maximum number of subscribers to return (default: 10).\n - `page`: The page number for pagination (default: 1).\n\n#### `add_subscriber(group_id: str, request: CreateSubscriberRequest)`\n\nAdds a subscriber to a group.\n\n- Parameters\n - `group_id`: The ID of the group.\n - `request`: An object containing subscriber details.\n\n#### `delete_subscriber(group_id: str, request: DeleteSubscriberRequest)`\n\nDeletes a subscriber from a group.\n\n- Parameters\n - `group_id`: The ID of the group.\n - `request`: An object containing the emails of subscribers to delete.\n\n#### `get_subscriber_by_email(group_id: str, email: str)`\n\nRetrieves subscriber details by email.\n\n- Parameters\n - `group_id`: The ID of the group.\n - `email`: The email address of the subscriber.\n\n### Messages Endpoints\n\n#### `get_message_info(schedule_id: str, email: str)`\n\nRetrieves information about a specific scheduled message.\n\n- Parameters\n - `schedule_id`: The ID of the scheduled message.\n - `email`: The email address to which the message was sent.\n\n#### `cancel_scheduled_message(request: CancelScheduledMessageRequest)`\n\nCancels a scheduled message.\n\n- Parameters\n - `request`: An object containing the scheduled message ID.\n\n#### `send_marketing(request: SendMarketingRequest)`\n\nSends a marketing email.\n\n- Parameters\n - `request`: An object for sending marketing emails.\n\n#### `send_message_by_template(request: SendMessageByTemplateRequest)`\n\nSends an email using a template.\n\n- Parameters\n - `request`: An object containing the message details and template ID.\n\n#### `get_schedule_info(schedule_id: str)`\n\nRetrieves schedule information for a specific scheduled message.\n\n- Parameters\n - `schedule_id`: The ID of the scheduled message.\n\n#### `send_transactional(request: SendTransactionalRequest)`\n\nSends a transactional email.\n\n- Parameters\n - `request`: An object for sending transactional emails.\n\n#### `send_transactional_by_template(request: SendMessageByTemplateRequest)`\n\nSends a transactional email using a template.\n\n- Parameters\n - `request`: An object containing the message details and template ID.\n\n### Outbound IP Endpoints\n\n#### `create_ip_group(request: CreateIpGroupRequest)`\n\nCreates a new IP group.\n\n- Parameters\n - `request`: An object containing the IP group details.\n\n#### `get_ip_group_info(name: str)`\n\nRetrieves information about a specific IP group.\n\n- Parameters\n - `name`: The name of the IP group.\n\n#### `list_ip_groups()`\n\nRetrieves a list of all IP groups.\n\n- No parameters.\n\n#### `cancel_warmup(request: CancelWarmUpRequest)`\n\nCancels a warmup process for an IP address.\n\n- Parameters\n - `request`: An object containing the IP address.\n\n#### `get_ip_info(ip: str)`\n\nRetrieves information about a specific IP address.\n\n- Parameters\n - `ip`: The IP address to retrieve.\n\n#### `list_ips()`\n\nRetrieves a list of all IP addresses.\n\n- No parameters.\n\n#### `set_ip_group(request: SetIpGroupRequest)`\n\nAssigns an IP address to a specific IP group.\n\n- Parameters\n - `request`: An object containing the IP address and group details.\n\n#### `start_warmup(request: StartWarmUpRequest)`\n\nStarts a warmup process for an IP address.\n\n- Parameters\n - `request`: An object containing the IP address.\n\nContributing\n------------\n\nContributions are always welcome! Please read the contributing guide for ways to contribute to this project.\n\nLicense\n-------\n\n`mepost-sdk` is released under the MIT License. See the LICENSE file for more details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python SDK for interacting with the Mepost API.",
"version": "1.0.5",
"project_urls": {
"Homepage": "https://github.com/mepost-io/python-sdk"
},
"split_keywords": [
"mepost",
" email",
" sdk",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b3b25c42b0ffcae6c14caf6a40edd73c501aa1442e80bae47128f45633ec0b80",
"md5": "945cd5b0f4c0ccfeead4521de30ae2a7",
"sha256": "3b135dcc304a6113e168038a8db2f2210811b5be5f1e9ec5ef59b910984366b0"
},
"downloads": -1,
"filename": "mepost_sdk-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "945cd5b0f4c0ccfeead4521de30ae2a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5266,
"upload_time": "2024-08-30T19:54:15",
"upload_time_iso_8601": "2024-08-30T19:54:15.192853Z",
"url": "https://files.pythonhosted.org/packages/b3/b2/5c42b0ffcae6c14caf6a40edd73c501aa1442e80bae47128f45633ec0b80/mepost_sdk-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "04a197580e75813b33dbc35a32d0605d37c6049e984d43f0da7b47f13aeba04d",
"md5": "000a2d3376e98edb9d4ecc6e11edb79f",
"sha256": "5e51542091939bab6311b13da4ed1c86e5be0cb14015acc3035edcc5f14b9637"
},
"downloads": -1,
"filename": "mepost_sdk-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "000a2d3376e98edb9d4ecc6e11edb79f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4796,
"upload_time": "2024-08-30T19:54:16",
"upload_time_iso_8601": "2024-08-30T19:54:16.843955Z",
"url": "https://files.pythonhosted.org/packages/04/a1/97580e75813b33dbc35a32d0605d37c6049e984d43f0da7b47f13aeba04d/mepost_sdk-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-30 19:54:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mepost-io",
"github_project": "python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mepost-sdk"
}