A Python library for interacting with Hey Telecom accounts
Project description
📱 HeyTelecom Python Library
"I just want my usage data" Edition 🚀
Quick Install | Getting Started | Features | Contributing
Automate your Hey! Telecom account. Get usage, invoices, and more without lifting a finger.
📦 Quick Install
For the Pythonistas 🐍:
pip install heytelecom
For the Container lovers 🐳:
This container exposes a simple endpoint that returns one giant JSON with everything you need. It was born to serve the Home Assistant add-on, but hey, free JSON is free JSON.
docker run -d \
--name 23118c7a-heytelecom-addon \
--restart unless-stopped \
-p 8099:8099 \
-e HEYTELECOM_EMAIL="your@email.com" \
-e HEYTELECOM_PASSWORD="your_password" \
-v heytelecom-data:/data \
ghcr.io/maurodruwel/heytelecom:latest
💡 Tip: The name 23118c7a-heytelecom-addon is the default hostname the Home Assistant integration looks for. If you are running Home Assistant in Docker (not HAOS), naming it this way makes the integration work out of the box!
🏠 Home Assistant Integration
This whole project was basically an excuse to get my data into Home Assistant. 😅
The Problem: You can't just run Playwright inside a standard Home Assistant integration. It's too heavy, requires a browser, and HA generally says "no thanks" to that. 🚫
The Solution: I split it up!
- The Add-on: A Docker container that runs Playwright and does the heavy lifting (scraping). It exposes the data as JSON.
- The Integration: A lightweight component that talks to the Add-on and creates sensors in HA.
It's the easiest way to get your "Hey!" usage on your dashboard without breaking your HA install.
🛠️ Getting Started
It's super simple. Just tell it who you are, and it does the rest.
from heytelecom import HeyTelecomClient
# Let the robot do the work 🤖
with HeyTelecomClient(email="your@email.com", password="your_password") as client:
client.login() # Knock knock 🚪
# Gimme the data!
account_data = client.get_account_data()
print(f"You have {len(account_data.products)} products.")
print(f"Latest invoice: €{account_data.billing.latest_invoice.amount_eur} (Ouch? 💸)")
🤖 How it Works
- The Setup: We use Playwright (a headless browser) to pretend to be a real human. 🎭
- The Login: It goes to the website, types in your stuff, and handles the session.
- The Grab: It scrapes the mobile/internet usage, invoices, and contract details.
- The Result: You get nice, clean Python objects to play with. No more parsing HTML yourself! 🤢
Note: The first time you run it, it might take a sec to download the browser. It's automatic, don't panic. 😱
✨ Features
- 🔐 Auto Login: Handles the boring auth stuff.
- 💾 Session Saving: Remembers you so it doesn't have to login every single time. Smart.
- 📱 Product Info: Mobile, Internet, whatever you got.
- 📊 Usage Stats: Data, Calls, SMS. Know when to stop scrolling TikTok.
- 💰 Invoices: Download them, track them, pay them (well, you still have to pay them).
- 🐳 Docker Ready: Comes with a REST API if you're into that.
📖 The Story (or "Why?")
So, here's the tea ☕. I wanted to integrate my mobile usage into my dashboard. I checked for an API. Crickets. 🦗
The official API is not open source and was extremely difficult to reverse engineer. I did some digging though (see the research folder if you're curious), but ultimately Playwright was the more reliable path.
I didn't want to manually check the website every time I was curious about my data cap. That's what robots are for! So I built this wrapper around Playwright to do the heavy lifting. It spins up a browser in the background (headless, so no popping windows to annoy you), logs in, and scrapes the data.
Now I can graph my data usage and feel guilty about it in real-time. 📈
🤝 Contributing
Found a bug? Want to add a feature? PRs are welcome! Let's make this thing better together. 🎉
Made with ❤️ and a lot of debugging.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file heytelecom-0.1.1.tar.gz.
File metadata
- Download URL: heytelecom-0.1.1.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b06a3207738a18093d2ee1d1842e0755475317634a84e5ecf566cc6f5608960
|
|
| MD5 |
2f0c5acadca576faab29d53e1c4b1884
|
|
| BLAKE2b-256 |
5940fbf5b1ca50dcfd7772e243afcb05d4c1b3af95018b817d1d98ec1adc1153
|
Provenance
The following attestation bundles were made for heytelecom-0.1.1.tar.gz:
Publisher:
publish.yml on MauroDruwel/HeyTelecom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
heytelecom-0.1.1.tar.gz -
Subject digest:
1b06a3207738a18093d2ee1d1842e0755475317634a84e5ecf566cc6f5608960 - Sigstore transparency entry: 763788863
- Sigstore integration time:
-
Permalink:
MauroDruwel/HeyTelecom@2496a20b74ec8d17f9760101e9ea0c74c6c96d62 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MauroDruwel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2496a20b74ec8d17f9760101e9ea0c74c6c96d62 -
Trigger Event:
push
-
Statement type:
File details
Details for the file heytelecom-0.1.1-py3-none-any.whl.
File metadata
- Download URL: heytelecom-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f331e2c26fa468c88804d1d364b19f3882a8d667ed5129ac998a988e5b7e70e
|
|
| MD5 |
246f18c54fb187ea4091fe1cce137dc9
|
|
| BLAKE2b-256 |
3234310b118989e14cd8bef0b8c84661df90eeda82be87aa91fed659d1629a9e
|
Provenance
The following attestation bundles were made for heytelecom-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on MauroDruwel/HeyTelecom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
heytelecom-0.1.1-py3-none-any.whl -
Subject digest:
9f331e2c26fa468c88804d1d364b19f3882a8d667ed5129ac998a988e5b7e70e - Sigstore transparency entry: 763788867
- Sigstore integration time:
-
Permalink:
MauroDruwel/HeyTelecom@2496a20b74ec8d17f9760101e9ea0c74c6c96d62 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MauroDruwel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2496a20b74ec8d17f9760101e9ea0c74c6c96d62 -
Trigger Event:
push
-
Statement type: