How do I send a notification to my phone from Python?
POST to your Lert link with requests. One call with a title and body and your phone buzzes — even locked in your pocket. No account, no API keys, no SDK beyond the library you already have.
Python is where you run the long stuff — training loops, scrapers, data pipelines, batch jobs — and it's exactly the stuff you don't want to babysit. Lert lets your script tap you on the shoulder when it's done or when something breaks. Because your Lert link is the credential, there's no SDK to import and no key to manage; a single requests.post does it.
Set it up in under 30 seconds
- Download the app. Open it once — there's no account to create. Your private link is on screen.
- Copy your link. One tap copies
https://lert.dev/p/your-id. - POST to it from Python. Add one
requests.postwherever you want the buzz.
Run the script and your phone buzzes.
Example: with the requests library
import requests requests.post( "https://lert.dev/p/your-id", json={ "title": "Training done ✅", "body": "Final accuracy: 94.2%", "tag": "ml", }, )
No auth header, no SDK — just requests.post. Drop it at the end of a job, in an except block, or anywhere a condition is met. On Python without requests, the standard-library urllib.request works too.
Tip: wrap long jobs in try/finally and send from the finally, so you get a buzz whether the run succeeds or crashes. Include the error in the body so you know which it was without opening your laptop.
Related setups
- Send a notification from Node.js
- Send a notification from a bash script
- Get notified when a database value changes
- Send a push notification in one line
See the full Python guide and the database alert notifications use case. It's free for one channel and 50 notifications a day; Lert Pro is $2.99/month for unlimited. Full details in the docs.
Let your script buzz your phone.
Download Lert, copy your link, add one requests.post. Your phone buzzes when the job's done.