**This library allows you to quickly and easily use the SendGrid Web API
via Python.**
Announcements
=============
**BREAKING CHANGE as of 2016.06.14**
Version ``3.X.X`` is a breaking change for the entire library.
Version 3.X.X brings you full support for all Web API v3 endpoints. We
have the following resources to get you started quickly:
- `SendGrid
Documentation <https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html>`__
- `Usage
Documentation <https://github.com/sendgrid/sendgrid-python/tree/master/USAGE.md>`__
- `Example
Code <https://github.com/sendgrid/sendgrid-python/tree/master/examples>`__
- `Migration from v2 to
v3 <https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html>`__
Thank you for your continued support!
All updates to this library is documented in our
`CHANGELOG <https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md>`__.
Installation
============
Setup Environment Variables
---------------------------
First, get your free SendGrid account
`here <https://sendgrid.com/free?source=sendgrid-python>`__.
Next, update your environment with your
`SENDGRID\_API\_KEY <https://app.sendgrid.com/settings/api_keys>`__.
.. code:: bash
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
Install Package
---------------
.. code:: bash
pip install sendgrid
or
.. code:: bash
easy_install sendgrid
Dependencies
------------
- The SendGrid Service, starting at the `free
level <https://sendgrid.com/free?source=sendgrid-python>`__)
- `Python-HTTP-Client <https://github.com/sendgrid/python-http-client>`__
Quick Start
===========
Hello Email
-----------
.. code:: python
import sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("test@example.com")
subject = "Hello World from the SendGrid Python Library"
to_email = Email("test@example.com")
content = Content("text/plain", "some text here")
mail = Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body=mail.get())
print(response.status_code)
print(response.body)
print(response.headers)
General v3 Web API Usage
------------------------
.. code:: python
import sendgrid
import os
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
response = sg.client.api_keys.get()
print(response.status_code)
print(response.body)
print(response.headers)
Usage
=====
- `SendGrid
Documentation <https://sendgrid.com/docs/API_Reference/index.html>`__
- `Usage
Documentation <https://github.com/sendgrid/sendgrid-python/tree/master/USAGE.md>`__
- `Example
Code <https://github.com/sendgrid/sendgrid-python/tree/master/examples>`__
- `v3 Web API Mail Send
Helper <https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail>`__
- build a request object payload for a v3 /mail/send API call.
Roadmap
-------
If you are intersted in the future direction of this project, please
take a look at our
`milestones <https://github.com/sendgrid/sendgrid-python/milestones>`__.
We would love to hear your feedback.
How to Contribute
-----------------
We encourage contribution to our libraries, please see our
`CONTRIBUTING <https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md>`__
guide for details.
Quick links:
- `Feature
Request <https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#feature_request>`__
- `Bug
Reports <https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#submit_a_bug_report>`__
- `Sign the CLA to Create a Pull
Request <https://github.com/sendgrid/sendgrid-open-source-templates/tree/master/CONTRIBUTING.md#cla>`__
- `Improvements to the
Codebase <https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements_to_the_codebase>`__
About
=====
sendgrid-python is guided and supported by the SendGrid `Developer
Experience Team <mailto:dx@sendgrid.com>`__.
sendgrid-python is maintained and funded by SendGrid, Inc. The names and
logos for sendgrid-python are trademarks of SendGrid, Inc.
.. |SendGrid Logo| image :: https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png
:target: https://www.sendgrid.com
.. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=master
:target: https://travis-ci.org/sendgrid/sendgrid-python
Metadata
Release files for sendgrid 3.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sendgrid-3.0.5.tar.gz | 9.9 kB | Without provenance | Details for sendgrid-3.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sendgrid-3.0.5-py2-none-any.whl | Python 2 | none | any | Details for sendgrid-3.0.5-py2-none-any.whl |
Total release size: 30.5 kB
Release files / sendgrid-3.0.5.tar.gz
| Download URL | sendgrid-3.0.5.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2fdb262d2a0de9540f4f1cbe4e854478890aaf7a304f99f9c93941152104fbd
|
|
BLAKE2b-256 checksum How to use checksums |
09db50d8298b494873882ab9ebe236f4133ac4d6a126542aab77a28143506bf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sendgrid-3.0.5-py2-none-any.whl
| Download URL | sendgrid-3.0.5-py2-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
eccdbd27a0a6665ab6db6e2c7e76d74f78902a4beed197ade14910e3d0435710
|
|
BLAKE2b-256 checksum How to use checksums |
3a35c73d938b61c74817899fc39884c3654c523077447406b6f51f4e143c0cc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sendgrid 3.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.