A package designed to make sending messages easy and efficient!
Project description
Join the conversation in the Messages Slack Team
Purpose
Messages is a package designed to make sending messages easy!
Messages incorporates various standard library module, third-party module, web app API calls, etc. all in one package.
Messages can send messages asynchronously.
Installation
$ pip install messages
Supported Messages
SMTP
- Text Messages (SMS/MMS)
Twilio API (must have API keys)
- Slack
Inbound Webhook API
Upcoming Messages
WhatsApp
Examples
>>> from messages import Email
>>> msg = 'Hello,\n\tTry this new package called "messages"!'
>>> m = Email(from_='me@here.com',
to='you@there.com',
body=msg,
attachments=['./file1.txt', '~/Documents/file2.pdf']
)
>>>
>>> m.send() # send synchronously
>>> m.send_async() # send asynchronously
Text Message
>>> from messages import Twilio
>>> msg = 'Hello,\n\tTry this new package called "messages"!'
>>> t = Twilio(from_='+16198675309',
to='+16195551212',
body=msg,
acct_sid='your API sid',
auth_token='your API token',
attachments='https://imgs.xkcd.com/comics/python.png'
)
>>>
>>> t.send() # send synchronously
>>> t.send_async() # send asynchronously
Slack - Inbound Webhook API
>>> from messages import SlackWebhook
>>> msg = 'Hello,\n\tTry this new package called "messages"!'
>>> s = SlackWebhook(url='webhook_url',
body=msg,
attachments='https://imgs.xkcd.com/comics/python.png'
)
>>>
>>> s.send() # send synchronously
>>> s.send_async() # send asynchronously
Contributing
Help Wanted!
All contributions are welcome to build upon the package!
If it’s a message, add it to messages!
Please read CONTRIBUTING for guidelines, as well as a TODO List for ideas on where to get started.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.