{ "info": { "author": "Vikram Sahu - DX Team, Pepipost & APIMatic", "author_email": "dx@pepipost.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "\r\n\r\n[](./LICENSE.txt)\r\n[](https://twitter.com/pepi_post)\r\n\r\n# Official Python library :snake: for [Pepipost](https://pepipost.com)\r\n\r\n This SDK contain methods for easily interacting with the Pepipost Email Sending API to send emails within few seconds.\r\n\r\nWe are trying to make our libraries a Community Driven. To help us building right things in proper order we would request you to help us by sharing comments, creating new issues or pull request.\r\n\r\n We welcome any sort of contribution to this library.\r\n\r\n The latest 2.5.0 version of this library provides is fully compatible with the latest Pepipost v2.0 API.\r\n\r\n For any update of this library check [Releases]\r\n\r\n## Table of Content\r\n* [Installation](#installation)\r\n* [Quick Start](#quickstart)\r\n* [Sample Example](#sample)\r\n* [Announcements](#announcements)\r\n* [Roadmap](#roadmap)\r\n* [About](#about)\r\n* [License](#license)\r\n\r\n\r\n\r\n## Installation \r\n\r\n There are two ways of installing the library for Pepipost either you can use \r\n\r\n ```pip install pepipost``` \r\n\r\n **OR**\r\n\r\n ```git clone https://github.com/hellovikram/pepipost-python.git pepipost_python``` \r\n\r\n Below are the steps inorder to install the library\r\n\r\n### Prerequisites\r\n * Python (2 >=2.7.9 or 3 >= 3.4)\r\n * Python IDE (we are using [Pycharm](https://www.jetbrains.com/pycharm/download/) )\r\n * Python packages \r\n * nose\r\n * jsonpickle\r\n * requests\r\n * cachecontrol\r\n * python-dateutil\r\n\r\n Installation of PIP can be done from [here](https://pip.pypa.io/en/stable/installing/).\r\n\r\n We recommend using PIP Dependency manager in order to install all the dependencies which we had mentioned in ```requirements.txt``` files that comes in SDK.\r\n\r\n\r\n### Defining Enviroment variable. \r\n\r\n * Python and PIP Should be defined in your PATH.\r\n * Check using \r\n\r\n ```pip --version``` --> Will display the version of PIP dependency manager installed.\r\n\r\n ```python --version``` --> Will display the version of Python installed \r\n\r\n which should be >=2.7.1 if you are using python 2 else it can be >=3.4 if you are using python 3.\r\n\r\n ![image]()\r\n\r\n * Use Command line to navigate to directory \r\n\r\n ```cd pepipost_python```\r\n\r\n\r\n\r\n### Quickstart\r\n\r\n 1. Using SDK from Github repository, Run the below command to download the requirements\r\n\r\n ```pip install -r requirement.txt```\r\n\r\n \r\n\r\n **OR**\r\n\r\n Using PIP dependency manager download our official library directly from PIP \r\n\r\n Run below Command inorder to download Pepipost library.\r\n\r\n ```pip install pepipost```\r\n\r\n 2. Open Project in an IDE\r\n\r\n Open up a Python IDE like PyCharm. \r\n The basic workflow presented here is also applicable if you prefer using a different editor or IDE.\r\n\r\n \r\n\r\n Click on ```Open``` in PyCharm to browse to your generated SDK directory and then\r\n\r\n click ```OK```\r\n\r\n  \r\n\r\n The project files will be displayed in the side bar as follows:\r\n\r\n  \r\n\r\n 3. Add a new Test Project\r\n\r\n Create a new directory by right clicking on the solution name as shown below:\r\n\r\n \r\n\r\n Name the directory as \"test\"\r\n\r\n \r\n\r\n Add a python file to this project with the name \"testsdk\"\r\n\r\n \r\n\r\n Name it \"testsdk\"\r\n\r\n \r\n\r\n 4. Importing files from python library\r\n\r\n Inorder to import file you need to just copy the [sample file from here](#sample). \r\n\r\n \r\n\r\n 5. Update API key and Sending Domain\r\n\r\n * apikey: This will be available under: Login to your Pepipost account -> Settings -> Integration.\r\n\r\n * FromEmail: If your fromemail address is e.g. info@mydomain.com, then the Sending Domain mydomain need to be verified and active under your Pepipost account. You can manage the Sending Domain under: Login to Pepipost -> Settings -> Sending Domains.\r\n\r\n 6. Run the Test Project\r\n\r\n To run the file \r\n\r\n ```ctrl+F5```\r\n\r\n **OR** \r\n\r\n Right click on your Python file inside your Test project and click on ```Run```\r\n\r\n \r\n\r\n\r\n### Sample Example\r\n\r\n```python\r\nfrom pepipost.pepipost_client import PepipostClient\r\nfrom pepipost.models.email_body import EmailBody\r\nfrom pepipost.models.personalizations import Personalizations\r\nfrom pepipost.models.attachments import Attachments\r\nfrom pepipost.models.mfrom import From\r\nfrom pepipost.models.email_body_attachments import EmailBodyAttachments\r\nfrom pepipost.models.settings import Settings\r\nfrom pepipost.exceptions.api_exception import APIException\r\nimport jsonpickle\r\n\r\nclient = PepipostClient()\r\nemail_controller = client.email\r\nbody = EmailBody()\r\nbody.personalizations = []\r\n\r\napi_key = 'api_key here '\r\nbody.personalizations.append(Personalizations())\r\nbody.personalizations[0].recipient = 'recipient@your-mail.com'\r\n\r\nbody.tags = 'tagsPython'\r\nbody.mfrom = From()\r\n\r\nbody.mfrom.from_email = 'example@your-verified-domain'\r\nbody.mfrom.from_name = 'Example Pepi'\r\nbody.subject = 'Emailing with Pepipost is easy'\r\nbody.content = '
Hey,