Python module to, send SMS, emails and read unread emails.
Project description
Gmail Connector
Python module to, send SMS, emails and read unread
emails in inbox
folder.
Uses the default python modules:
email
- Format emails asMIMEMultipart
object, read emails frombytes
andstr
and decode headers.smtplib
-SMTP
Simple Mail Transfer Protocol to connect togmail
server, doauth
and perform outgoing tasks.imaplib
-IMAP
Internet Message Access Protocol to access messages in an email mailbox.datetime
- Usesdatetime
module to skim the date and time when the email arrived.
Pypi Module
https://pypi.org/project/gmail-connector/
Usage
pip install gmail-connector
from gmailconnector.send_sms import Messenger
messenger = Messenger(
gmail_user='username@gmail.com',
gmail_pass='<ACCOUNT_PASSWORD>',
phone_number='+11234567890',
message='Test SMS using gmail-connector'
)
print(messenger.send_sms())
from gmailconnector.send_email import SendEmail
email_obj = SendEmail(
gmail_user='username@gmail.com',
gmail_pass='<ACCOUNT_PASSWORD>',
recipient='another_username@gmail.com',
subject='Howdy!'
)
print(email_obj.send_email())
More on SendEmail
Additional args:
- body: Body of the email. Defaults to blank.
- attachment: Filename that has to be attached.
- cc: Email address of the recipient to whom the email has to be CC'd.
- bcc: Email address of the recipient to whom the email has to be BCC'd.
Note: To send email to more than one recipient, wrap
recipient
/cc
/bcc
in a list.
recipient=['username1@gmail.com', 'username2@gmail.com']
from gmailconnector.read_email import ReadEmail
ReadEmail(
gmail_user='username@gmail.com',
gmail_pass='<ACCOUNT_PASSWORD>'
).read_email()
Linting
PreCommit
will ensure linting, and the doc creation are run on every commit.
Requirement
pip install --no-cache --upgrade sphinx pre-commit
Usage
pre-commit run --all-files
Change Log
Requirement
pip install --no-cache --upgrade changelog-generator
Usage
changelog
Runbook
https://thevickypedia.github.io/gmail-connector/
License & copyright
© Vignesh Sivanandha Rao, Gmail Connector
Licensed under the MIT License
Change Log
0.0.1 (06/07/2020)
- Initial commit
0.0.2 (06/08/2020)
- read raw email
0.0.3 (06/08/2020)
- decode raw email using email library
0.0.4 (06/08/2020)
- decode body of the email and display only text part
0.0.5 (06/08/2020)
- added time when the email was received
0.0.6 (06/08/2020)
- pdt to cdt
0.0.7 (06/08/2020)
- user input condition to read email
0.0.8 (06/08/2020)
- include number of unread emails on top
0.0.9 (06/08/2020)
- get user input before showing any content
0.1.0 (06/08/2020)
- get user input before reading multiple emails
0.1.1 (06/08/2020)
- added comments
0.1.2 (06/08/2020)
- improve coding standards
0.1.3 (06/09/2020)
- improve coding standards
0.1.4 (06/11/2020)
- fix typo
0.1.5 (06/27/2020)
- modify date time type standards instead of using index values
0.1.6 (06/27/2020)
- included exception handler
0.1.7 (06/28/2020)
- look for env variables before failing
0.1.8 (06/28/2020)
- add LICENSE
0.1.9 (06/28/2020)
- update README.md
0.2.0 (07/17/2021)
- Refactor read_email.py and add send_email.py
- Add pre-commit for linting
- Update README.md
0.2.1 (07/17/2021)
- Onboard sphinx auto generated documentation
0.2.2 (07/18/2021)
- Onboard send_sms.py and update docs
0.2.3 (07/18/2021)
- Increase page width and update README.md
0.2.4 (07/18/2021)
- Onboard
pypi
module - Add
setup.py
,setup.cfg
,__init__.py
,CHANGELOG
- Update README.md and docs
- Move files to
gmailconnector
support package
0.2.5 (07/19/2021)
- Add badges
- Update README.md and CHANGELOG
- Bump version
0.2.6 (07/19/2021)
- onboard docs.yml but only prints a statement
0.2.7 (07/19/2021)
- auto upload to pypi when tagged a release version
0.2.8 (07/19/2021)
- Bump version to support github action
- Auto upload to pypi
0.2.9 (07/19/2021)
- Add logging
- Remove print statements
- Bump version
0.3.0 (07/19/2021)
- Allow users to add multiple recipients while sending email.
- Add CC and BCC options.
- Check if attachment file is available before trying to attach.
- Wrap recipient, cc and bcc items in a single list before email kick off.
- Remove sender arg and default to the user login email address.
- Fix version number format.
0.3.1 (07/22/2021)
- Return a dictionary element after sending an email/SMS.
- Add status code and description to return dict.
- Update docs and CHANGELOG
- Bump version.
0.3.2 (07/24/2021)
- Remove logger module.
- Add exception handlers for Messenger class.
- Update docs and CHANGELOG
- Bump version.
0.3.3 (08/04/2021)
- Fix incorrect HTTP return codes
0.3.4 (08/11/2021)
- Add new lines to the message start to separate subject and body of the SMS
- Update sphinx documentation to 4.1.2
0.3.5 (10/16/2021)
- Add project URLs and package requirements to pypi
- Add markdown support to sphinx autodocs
- Add a condition check for version upgrade
- Update docs and changelog
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.
Source Distribution
Built Distribution
Hashes for gmail_connector-0.3.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7db03e3848a87acc0eb7a7ecad558bf9e70a3b67523c90f654839c04bf9feac0 |
|
MD5 | 77a7c3cbc39c34a07c3ae644c4d644dc |
|
BLAKE2b-256 | f1238c37b1cb20133b604738f5632bc81ab81f8bf00574ad4f45decd5184e8f6 |