Home/Answers/Send a notification from Python
Answer

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

  1. Download the app. Open it once — there's no account to create. Your private link is on screen.
  2. Copy your link. One tap copies https://lert.dev/p/your-id.
  3. POST to it from Python. Add one requests.post wherever you want the buzz.

Run the script and your phone buzzes.

Example: with the requests library

python
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

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.

Get the app iOS