Coder Social home page Coder Social logo

dozy-programmer / notify-mi Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 84 KB

๐Ÿ”” Notify Mi simplifies sending yourself text and email notifcations from your personal projects by utilizing your gmail account.

License: MIT License

Python 100.00%
python gmail-smtp email-notification file-attachment text-notifications mms sms

notify-mi's Introduction

Notify Mi

๐Ÿ”” Notify Mi simplifies sending yourself text and email notifications from your personal projects by utilizing your gmail account. It is a convenient and cost-effective solution with the goal of providing you an easy and free way to send messages in response to events.

Notify Mi is particularly useful when working with IoT devices. It can allow you to receive messages in response to events such as when a sensor value reaches a certain threshold, when a sensor detects something, when a sensor encounters an error, or when a daily or custom timed event occurs. This makes it easy to keep track of what is happening with your IoT device and react to any change or issue that may arise.

With Notify Mi, you can also attach a file with your text or email message. The maximum file size allowed is 1 MB and you can use any of the 69 supported file types, thus providing you flexibility in the type of attachment you want to include in your messages.

Table of Contents

Purpose:

Sending notifications through your Gmail account is not a novel idea. Notify Mi is designed to be a modular and reliable way to send notifications without having to spend time and effort figuring out how to do it each time you want to add this feature to your project. Plus, the implementation process is straightforward and takes only a couple of minutes. This way, you can focus on other aspects of your project and save time.

Getting Started:

  1. Generate an app password for your gmail account by clicking here.
    โคท place your gmail and app password in a tuple:
    โ€ƒ ย  ย  โคท ("gmail_address", "app_password") โคถ
    โคท (optional) step by step guide on how to generate an app password.

  2. Install Notify Mi

# 2. install notify_mi using pip
pip install notify_mi

# โœ”๏ธ That's it, now you are ready to use

Usage:

Import
from notify_mi import notify
Text messsage Only
# send only a text message
# include phone_number and phone_provider (see providers list below)
# phone number: "(619) 123-4567", "619-123-4567", or "6191234567" (all acceptable)
notify.send_message("Hello World!", 
       ("gmail", "app_password"), 
       phone_number = "your_number", 
       phone_provider= "your_phone_provider")
Text + Email
# send text message + email
# include phone_number, phone_provider (see providers list below), and receiver email
# phone number: "(619) 123-4567", "619-123-4567", or "6191234567" (all acceptable)
notify.send_message("Hello World!", 
       ("gmail", "app_password"), 
       phone_number = "your_number", 
       phone_provider= "your_phone_provider", 
       send_to = "[email protected]")
Email Only
# send only email
# include receiver email
notify.send_message("Hello World!", 
       ("gmail", "app_password"), 
       send_to = "[email protected]")
Optional Parameters
# add a subject line to the message
notify.send_message(subject = "EMERGENCY", 
       message = "No sweets detected in fridge!")

# add a file attachment (69 file types supported)
notify.send_message(subject = "I found it", 
       message = "My dream car", 
       file_attachment = "/path/car.png")

# run without blocking main thread
notify.send_message("Hello World!", 
       threaded = True)
Available Parameters
# this is all the parameters you can use
notify.send_message(threaded = True,
       file_attachment = "/path/to/file"
       phone_number = "your_number", 
       phone_provider = "your_phone_provider", 
       send_to = "[email protected]",
       sender_credentials = ("gmail", "app_password"), 
       message = "No sweets detected in fridge!")

List of Phone Providers

# Select From: 
"AT&T", "Boost Mobile", "C-Spire", "Cricket Wireless", 
"Consumer Cellular", "Google Project Fi", "Metro PCS", 
"Mint Mobile", "Page Plus", "Republic Wireless", "Sprint",
"Straight Talk", "T-Mobile", "Ting", "Tracfone", 
"U.S. Cellular", "Verizon", "Virgin Mobile", "Xfinity Mobile"

Special Thanks:

Alfredo Sequeida for writing a detailed article and for making a great video that went step by step on how to send text messages using python. It was very useful for one of my projects so I am adding to what he did so that other people can find it useful.

Alfredo also made a package named etext so check that out!

notify-mi's People

Contributors

dozy-programmer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.