Python wrapper for Postmark Inbound
Project description
POSTMARK INBOUND HOOK
=====================
This is a simple API wrapper for `Postmark Inbound Hook`_ in Python
inspired by `jjaffeux`_.
Install
-------
Using Github:
::
git clone git@github.com:jpadilla/postmark-inbound-python.git
Using pip:
::
pip install python-postmark-inbound
Using easy\_install:
::
easy_install python-postmark-inbound
Usage
-----
.. code:: python
from postmark_inbound import PostmarkInbound
# load json
json_data = open('./tests/fixtures/valid_http_post.json').read()
inbound = PostmarkInbound(json=json_data)
# content
inbound.subject()
inbound.sender()
inbound.to()
inbound.bcc()
inbound.tag()
inbound.message_id()
inbound.mailbox_hash()
inbound.reply_to()
inbound.html_body()
inbound.text_body()
inbound.send_date()
# headers
inbound.headers() # default to get Date
inbound.headers('MIME-Version')
inbound.headers('Received-SPF')
# spam
inbound.headers('X-Spam-Checker-Version')
inbound.headers('X-Spam-Score')
inbound.headers('X-Spam-Tests')
inbound.headers('X-Spam-Status')
# attachments
inbound.has_attachments() # boolean
attachments = inbound.attachments()
first_attachment = attachments[0]
first_attachment.name()
second_attachment = attachments[1]
second_attachment.content_length()
for a in attachments:
a.name()
a.content_type()
a.content_length()
a.download('./tests/', ['image/png'], '10000')
# raw data
inbound.json
inbound.source
Bug tracker
-----------
Have a bug? Please create an issue here on GitHub!
Contributions
-------------
- Fork
- Write tests
- Write Code
- Pull request
Thanks for your help.
TODO
----
- Write more tests
Authors
-------
**José Padilla**
- http://twitter.com/jpadilla\_
- http://github.com/jpadilla
Inspiration
-----------
Thanks to `jjaffeux`_ for the original PHP wrapper
- https://github.com/jjaffeux
- https://github.com/jjaffeux/postmark-inbound-php
Other libraries
---------------
- Ruby: https://github.com/r38y/postmark-mitt
- PHP: https://github.com/jjaffeux/postmark-inbound-php
- Node.js + CouchDB: https://gist.github.com/1647808
License
-------
MIT License
.. _Postmark Inbound Hook: http://developer.postmarkapp.com/developer-inbound.html
.. _jjaffeux: https://github.com/jjaffeux/postmark-inbound-php
.. _jjaffeux: https://github.com/jjaffeux/
=====================
This is a simple API wrapper for `Postmark Inbound Hook`_ in Python
inspired by `jjaffeux`_.
Install
-------
Using Github:
::
git clone git@github.com:jpadilla/postmark-inbound-python.git
Using pip:
::
pip install python-postmark-inbound
Using easy\_install:
::
easy_install python-postmark-inbound
Usage
-----
.. code:: python
from postmark_inbound import PostmarkInbound
# load json
json_data = open('./tests/fixtures/valid_http_post.json').read()
inbound = PostmarkInbound(json=json_data)
# content
inbound.subject()
inbound.sender()
inbound.to()
inbound.bcc()
inbound.tag()
inbound.message_id()
inbound.mailbox_hash()
inbound.reply_to()
inbound.html_body()
inbound.text_body()
inbound.send_date()
# headers
inbound.headers() # default to get Date
inbound.headers('MIME-Version')
inbound.headers('Received-SPF')
# spam
inbound.headers('X-Spam-Checker-Version')
inbound.headers('X-Spam-Score')
inbound.headers('X-Spam-Tests')
inbound.headers('X-Spam-Status')
# attachments
inbound.has_attachments() # boolean
attachments = inbound.attachments()
first_attachment = attachments[0]
first_attachment.name()
second_attachment = attachments[1]
second_attachment.content_length()
for a in attachments:
a.name()
a.content_type()
a.content_length()
a.download('./tests/', ['image/png'], '10000')
# raw data
inbound.json
inbound.source
Bug tracker
-----------
Have a bug? Please create an issue here on GitHub!
Contributions
-------------
- Fork
- Write tests
- Write Code
- Pull request
Thanks for your help.
TODO
----
- Write more tests
Authors
-------
**José Padilla**
- http://twitter.com/jpadilla\_
- http://github.com/jpadilla
Inspiration
-----------
Thanks to `jjaffeux`_ for the original PHP wrapper
- https://github.com/jjaffeux
- https://github.com/jjaffeux/postmark-inbound-php
Other libraries
---------------
- Ruby: https://github.com/r38y/postmark-mitt
- PHP: https://github.com/jjaffeux/postmark-inbound-php
- Node.js + CouchDB: https://gist.github.com/1647808
License
-------
MIT License
.. _Postmark Inbound Hook: http://developer.postmarkapp.com/developer-inbound.html
.. _jjaffeux: https://github.com/jjaffeux/postmark-inbound-php
.. _jjaffeux: https://github.com/jjaffeux/
Project details
None NoneDownload files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for python-postmark-inbound-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89411db4089c51d6ed5298033a8b793fae667b25072f7ca6112c6d1595d10c2e |
|
MD5 | e10245267afbaf9e1f0625770116f1d4 |
|
BLAKE2b-256 | 53ab26d53eddf01f2a120992069d7f75d9b8d0e5914c95d73b48c823afce8dd6 |