Unnoficial wrapper for interacting with the SendGrid's Web API V3.
Supports Python 2.7+. NOT TESTED IN PYTHON 3 (yet).
Check the requirements.txt
for a complete list of dependecies of this library.
Install everything it needs with pip install -r /path/to/requirements.txt
from sendgridmarketingapi.wrapper import SendGridClientWrapper
from sendgridmarketingapi.campaigns import CampaignsManager
apikey = 'your-sendgrid-api-key'
client = SendGridClientWrapper(apikey)
campaign_manager = CampaignsManager(client)
status, data = campaign_manager.get_all_campaigns()
Tests were built using Py.test with some extensions (pytest-cov, pytest-pep8) and Radon.
Check the requirements.txt
for a complete list of dependecies of this library.
Note: You should set up an environment variable named SENDGRID_TEST_API_KEY with an valid api key for testing. If you didn't set it before, the script will ask before running the tests.
cd /path/to/project
./runtests.sh
If you want to check radon analysis, you shoud use --with-radon
or -r
options:
./runtests.sh --with-radon
./runtests.sh -r