heytelecom 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- heytelecom-0.1.0/LICENSE +21 -0
- heytelecom-0.1.0/PKG-INFO +300 -0
- heytelecom-0.1.0/README.md +272 -0
- heytelecom-0.1.0/pyproject.toml +46 -0
- heytelecom-0.1.0/setup.cfg +4 -0
- heytelecom-0.1.0/src/heytelecom/__init__.py +22 -0
- heytelecom-0.1.0/src/heytelecom/client.py +500 -0
- heytelecom-0.1.0/src/heytelecom/installer.py +57 -0
- heytelecom-0.1.0/src/heytelecom/models.py +132 -0
- heytelecom-0.1.0/src/heytelecom/parsers.py +101 -0
- heytelecom-0.1.0/src/heytelecom.egg-info/PKG-INFO +300 -0
- heytelecom-0.1.0/src/heytelecom.egg-info/SOURCES.txt +14 -0
- heytelecom-0.1.0/src/heytelecom.egg-info/dependency_links.txt +1 -0
- heytelecom-0.1.0/src/heytelecom.egg-info/entry_points.txt +2 -0
- heytelecom-0.1.0/src/heytelecom.egg-info/requires.txt +5 -0
- heytelecom-0.1.0/src/heytelecom.egg-info/top_level.txt +1 -0
heytelecom-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mauro Druwel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: heytelecom
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python library for interacting with Hey Telecom accounts
|
|
5
|
+
Author-email: CoderMauro <mauro.druwel@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/maurodruwel/heytelecom
|
|
7
|
+
Project-URL: Repository, https://github.com/maurodruwel/heytelecom
|
|
8
|
+
Keywords: hey,telecom,hey!,belgium,mobile,internet
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: playwright
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# HeyTelecom Python Library
|
|
30
|
+
|
|
31
|
+
<img width="1280" height="668" alt="HeyTelecom Banner" src="https://github.com/user-attachments/assets/d141fb44-e5c3-48af-a2b0-42ba4d2c510f" />
|
|
32
|
+
|
|
33
|
+
<p align="center">
|
|
34
|
+
<img alt="PyPI" src="https://img.shields.io/pypi/v/heytelecom"/>
|
|
35
|
+
<img alt="Python Version" src="https://img.shields.io/pypi/pyversions/heytelecom"/>
|
|
36
|
+
<img alt="License" src="https://img.shields.io/github/license/MauroDruwel/HeyTelecom"/>
|
|
37
|
+
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/MauroDruwel/HeyTelecom"/>
|
|
38
|
+
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/MauroDruwel/HeyTelecom"/>
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<a href="#installation">Installation</a> -
|
|
43
|
+
<a href="#quick-start">Quick Start</a> -
|
|
44
|
+
<a href="#features">Features</a> -
|
|
45
|
+
<a href="#api-reference">API Reference</a> -
|
|
46
|
+
<a href="https://github.com/MauroDruwel/HeyTelecom/issues">Bug Reports</a>
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
A Python library for interacting with [Hey Telecom](https://ecare.heytelecom.be) (hey!) accounts using Playwright for web automation. Automatically extract your mobile/internet usage, invoices, and account information.
|
|
50
|
+
|
|
51
|
+
## Features
|
|
52
|
+
|
|
53
|
+
- 🔐 Automatic login with session persistence
|
|
54
|
+
- 📱 Retrieve mobile and internet product information
|
|
55
|
+
- 📊 Get usage data (data, calls, SMS/MMS)
|
|
56
|
+
- 💰 Fetch invoice information
|
|
57
|
+
- 🎭 Built on Playwright for reliable web automation (headless only)
|
|
58
|
+
- 🔧 Object-oriented API for easy integration
|
|
59
|
+
- 🚀 Chromium browser with automatic dependency installation
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install heytelecom
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from heytelecom import HeyTelecomClient
|
|
71
|
+
|
|
72
|
+
with HeyTelecomClient(email="your@email.com", password="your_password") as client:
|
|
73
|
+
client.login()
|
|
74
|
+
account_data = client.get_account_data()
|
|
75
|
+
|
|
76
|
+
import json
|
|
77
|
+
print(json.dumps(account_data.to_dict(), indent=2))
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## API Reference
|
|
81
|
+
|
|
82
|
+
### HeyTelecomClient
|
|
83
|
+
|
|
84
|
+
Main client class for interacting with Hey Telecom.
|
|
85
|
+
|
|
86
|
+
#### Constructor
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
HeyTelecomClient(
|
|
90
|
+
email: Optional[str] = None,
|
|
91
|
+
password: Optional[str] = None,
|
|
92
|
+
user_data_dir: str = "hey_browser_data",
|
|
93
|
+
auto_install: bool = True
|
|
94
|
+
)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Parameters:**
|
|
98
|
+
- `email`: Email address for login (optional if using saved session)
|
|
99
|
+
- `password`: Password for login (optional if using saved session)
|
|
100
|
+
- `user_data_dir`: Directory to store browser session data (default: "hey_browser_data")
|
|
101
|
+
- `auto_install`: Automatically install Playwright chromium if not found (default: True)
|
|
102
|
+
|
|
103
|
+
**Note:** Browser always runs in headless mode (no GUI) for reliable automation.
|
|
104
|
+
|
|
105
|
+
**Auto-Installation:**
|
|
106
|
+
When `auto_install=True` (default), the client automatically checks if Playwright chromium is installed when connecting. The check works by attempting to launch chromium - if it fails, the installer runs `playwright install chromium --with-deps --only-shell`. Set `auto_install=False` to disable this behavior and handle installation manually.
|
|
107
|
+
|
|
108
|
+
#### Methods
|
|
109
|
+
|
|
110
|
+
- `login()`: Login to Hey Telecom account
|
|
111
|
+
- `get_products()`: Get list of all products (mobile and internet)
|
|
112
|
+
- `get_latest_invoice()`: Get the latest invoice
|
|
113
|
+
- `get_account_data()`: Get complete account data including products and invoice
|
|
114
|
+
|
|
115
|
+
### Data Models
|
|
116
|
+
|
|
117
|
+
#### Product
|
|
118
|
+
- `product_id`: Unique product identifier
|
|
119
|
+
- `product_type`: Type of product ("mobile" or "internet")
|
|
120
|
+
- `phone_number`: Phone number (for mobile products)
|
|
121
|
+
- `easy_switch_number`: Easy Switch number (for internet products)
|
|
122
|
+
- `tariff`: Tariff/plan name
|
|
123
|
+
- `contract`: Contract information (Contract object)
|
|
124
|
+
- `usage`: Usage data (UsageData object)
|
|
125
|
+
|
|
126
|
+
#### Contract
|
|
127
|
+
- `start_date`: Contract start date (ISO format)
|
|
128
|
+
- `price_per_month_eur`: Monthly price in EUR
|
|
129
|
+
|
|
130
|
+
#### UsageData
|
|
131
|
+
- `period`: Billing period with start and end dates
|
|
132
|
+
- `data`: Data usage information (used, limit, unlimited)
|
|
133
|
+
- `calls`: Call usage information (used, unlimited)
|
|
134
|
+
- `sms_mms`: SMS/MMS usage information (used, unlimited)
|
|
135
|
+
|
|
136
|
+
#### Invoice
|
|
137
|
+
- `invoice_id`: Invoice identifier
|
|
138
|
+
- `amount_eur`: Invoice amount in EUR
|
|
139
|
+
- `status`: Invoice status
|
|
140
|
+
- `paid`: Whether invoice is paid (boolean)
|
|
141
|
+
- `date`: Invoice date (ISO format)
|
|
142
|
+
- `due_date`: Invoice due date (ISO format)
|
|
143
|
+
|
|
144
|
+
#### AccountData
|
|
145
|
+
- `provider`: Provider name (always "hey!")
|
|
146
|
+
- `last_sync`: Last synchronization timestamp
|
|
147
|
+
- `products`: List of Product objects
|
|
148
|
+
- `latest_invoice`: Latest Invoice object
|
|
149
|
+
|
|
150
|
+
## Example Output
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"provider": "hey!",
|
|
155
|
+
"account": {
|
|
156
|
+
"last_sync": "2025-11-09T15:30:00"
|
|
157
|
+
},
|
|
158
|
+
"products": [
|
|
159
|
+
{
|
|
160
|
+
"id": "mobile_0412345678",
|
|
161
|
+
"type": "mobile",
|
|
162
|
+
"phone_number": "0412 34 56 78",
|
|
163
|
+
"tariff": "Hey! Mobile Plus",
|
|
164
|
+
"contract": {
|
|
165
|
+
"start_date": "2024-01-15",
|
|
166
|
+
"price_per_month_eur": 15.0
|
|
167
|
+
},
|
|
168
|
+
"usage": {
|
|
169
|
+
"period": {
|
|
170
|
+
"start": "2025-10-11",
|
|
171
|
+
"end": "2025-11-11"
|
|
172
|
+
},
|
|
173
|
+
"data": {
|
|
174
|
+
"used": 2.5,
|
|
175
|
+
"limit": 10.0,
|
|
176
|
+
"unlimited": false,
|
|
177
|
+
"last_update": "2025-11-09T14:30:00"
|
|
178
|
+
},
|
|
179
|
+
"calls": {
|
|
180
|
+
"used": 45.0,
|
|
181
|
+
"unlimited": true,
|
|
182
|
+
"last_update": "2025-11-09T14:30:00"
|
|
183
|
+
},
|
|
184
|
+
"sms_mms": {
|
|
185
|
+
"used": 12,
|
|
186
|
+
"unlimited": true,
|
|
187
|
+
"last_update": "2025-11-09T14:30:00"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"billing": {
|
|
193
|
+
"latest_invoice": {
|
|
194
|
+
"invoice_id": "INV-20251101",
|
|
195
|
+
"amount_eur": 15.0,
|
|
196
|
+
"status": "betaald",
|
|
197
|
+
"paid": true,
|
|
198
|
+
"date": "2025-11-01",
|
|
199
|
+
"due_date": "2025-11-15"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Project Structure
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
heytestdev/
|
|
209
|
+
├── src/
|
|
210
|
+
│ └── heytelecom/
|
|
211
|
+
│ ├── __init__.py # Package initialization and exports
|
|
212
|
+
│ ├── client.py # Main HeyTelecomClient class
|
|
213
|
+
│ ├── models.py # Data models (Product, Invoice, etc.)
|
|
214
|
+
│ ├── parsers.py # Parsing utilities
|
|
215
|
+
│ └── installer.py # Playwright installation utilities
|
|
216
|
+
├── README.md # This file
|
|
217
|
+
├── pyproject.toml # Package configuration
|
|
218
|
+
└── .gitignore # Git ignore rules
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Requirements
|
|
222
|
+
|
|
223
|
+
- Python 3.8+
|
|
224
|
+
- playwright
|
|
225
|
+
|
|
226
|
+
## Advanced Usage
|
|
227
|
+
|
|
228
|
+
### Using Saved Sessions
|
|
229
|
+
|
|
230
|
+
After the first login, the browser session is saved. You can use the library without credentials:
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
from heytelecom import HeyTelecomClient
|
|
234
|
+
|
|
235
|
+
with HeyTelecomClient() as client:
|
|
236
|
+
account_data = client.get_account_data()
|
|
237
|
+
print(f"Found {len(account_data.products)} products")
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Getting Specific Data
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
from heytelecom import HeyTelecomClient
|
|
244
|
+
|
|
245
|
+
with HeyTelecomClient() as client:
|
|
246
|
+
# Get only products
|
|
247
|
+
products = client.get_products()
|
|
248
|
+
for product in products:
|
|
249
|
+
print(f"Product: {product.tariff}")
|
|
250
|
+
print(f"Type: {product.product_type}")
|
|
251
|
+
if product.usage:
|
|
252
|
+
print(f"Usage: {product.usage.to_dict()}")
|
|
253
|
+
|
|
254
|
+
# Get only latest invoice
|
|
255
|
+
invoice = client.get_latest_invoice()
|
|
256
|
+
if invoice:
|
|
257
|
+
print(f"Invoice: {invoice.amount_eur} EUR")
|
|
258
|
+
print(f"Status: {invoice.status}")
|
|
259
|
+
print(f"Paid: {invoice.paid}")
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Manual Playwright Installation
|
|
263
|
+
|
|
264
|
+
Playwright chromium is automatically installed on first use. If you prefer manual installation:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Manual installation (optional)
|
|
268
|
+
playwright install chromium --with-deps --only-shell
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Or use the built-in installer:
|
|
272
|
+
|
|
273
|
+
```python
|
|
274
|
+
from heytelecom import ensure_playwright_installed
|
|
275
|
+
ensure_playwright_installed()
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Disabling Auto-Installation
|
|
279
|
+
|
|
280
|
+
If you prefer to handle Playwright installation manually:
|
|
281
|
+
|
|
282
|
+
```python
|
|
283
|
+
from heytelecom import HeyTelecomClient
|
|
284
|
+
|
|
285
|
+
with HeyTelecomClient(auto_install=False) as client:
|
|
286
|
+
account_data = client.get_account_data()
|
|
287
|
+
print(account_data.to_dict())
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Contributing
|
|
291
|
+
|
|
292
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
293
|
+
|
|
294
|
+
## License
|
|
295
|
+
|
|
296
|
+
MIT License
|
|
297
|
+
|
|
298
|
+
## Support
|
|
299
|
+
|
|
300
|
+
For issues and questions, please open an issue on the GitHub repository.
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# HeyTelecom Python Library
|
|
2
|
+
|
|
3
|
+
<img width="1280" height="668" alt="HeyTelecom Banner" src="https://github.com/user-attachments/assets/d141fb44-e5c3-48af-a2b0-42ba4d2c510f" />
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img alt="PyPI" src="https://img.shields.io/pypi/v/heytelecom"/>
|
|
7
|
+
<img alt="Python Version" src="https://img.shields.io/pypi/pyversions/heytelecom"/>
|
|
8
|
+
<img alt="License" src="https://img.shields.io/github/license/MauroDruwel/HeyTelecom"/>
|
|
9
|
+
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/MauroDruwel/HeyTelecom"/>
|
|
10
|
+
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/MauroDruwel/HeyTelecom"/>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="#installation">Installation</a> -
|
|
15
|
+
<a href="#quick-start">Quick Start</a> -
|
|
16
|
+
<a href="#features">Features</a> -
|
|
17
|
+
<a href="#api-reference">API Reference</a> -
|
|
18
|
+
<a href="https://github.com/MauroDruwel/HeyTelecom/issues">Bug Reports</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
A Python library for interacting with [Hey Telecom](https://ecare.heytelecom.be) (hey!) accounts using Playwright for web automation. Automatically extract your mobile/internet usage, invoices, and account information.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- 🔐 Automatic login with session persistence
|
|
26
|
+
- 📱 Retrieve mobile and internet product information
|
|
27
|
+
- 📊 Get usage data (data, calls, SMS/MMS)
|
|
28
|
+
- 💰 Fetch invoice information
|
|
29
|
+
- 🎭 Built on Playwright for reliable web automation (headless only)
|
|
30
|
+
- 🔧 Object-oriented API for easy integration
|
|
31
|
+
- 🚀 Chromium browser with automatic dependency installation
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install heytelecom
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from heytelecom import HeyTelecomClient
|
|
43
|
+
|
|
44
|
+
with HeyTelecomClient(email="your@email.com", password="your_password") as client:
|
|
45
|
+
client.login()
|
|
46
|
+
account_data = client.get_account_data()
|
|
47
|
+
|
|
48
|
+
import json
|
|
49
|
+
print(json.dumps(account_data.to_dict(), indent=2))
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## API Reference
|
|
53
|
+
|
|
54
|
+
### HeyTelecomClient
|
|
55
|
+
|
|
56
|
+
Main client class for interacting with Hey Telecom.
|
|
57
|
+
|
|
58
|
+
#### Constructor
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
HeyTelecomClient(
|
|
62
|
+
email: Optional[str] = None,
|
|
63
|
+
password: Optional[str] = None,
|
|
64
|
+
user_data_dir: str = "hey_browser_data",
|
|
65
|
+
auto_install: bool = True
|
|
66
|
+
)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Parameters:**
|
|
70
|
+
- `email`: Email address for login (optional if using saved session)
|
|
71
|
+
- `password`: Password for login (optional if using saved session)
|
|
72
|
+
- `user_data_dir`: Directory to store browser session data (default: "hey_browser_data")
|
|
73
|
+
- `auto_install`: Automatically install Playwright chromium if not found (default: True)
|
|
74
|
+
|
|
75
|
+
**Note:** Browser always runs in headless mode (no GUI) for reliable automation.
|
|
76
|
+
|
|
77
|
+
**Auto-Installation:**
|
|
78
|
+
When `auto_install=True` (default), the client automatically checks if Playwright chromium is installed when connecting. The check works by attempting to launch chromium - if it fails, the installer runs `playwright install chromium --with-deps --only-shell`. Set `auto_install=False` to disable this behavior and handle installation manually.
|
|
79
|
+
|
|
80
|
+
#### Methods
|
|
81
|
+
|
|
82
|
+
- `login()`: Login to Hey Telecom account
|
|
83
|
+
- `get_products()`: Get list of all products (mobile and internet)
|
|
84
|
+
- `get_latest_invoice()`: Get the latest invoice
|
|
85
|
+
- `get_account_data()`: Get complete account data including products and invoice
|
|
86
|
+
|
|
87
|
+
### Data Models
|
|
88
|
+
|
|
89
|
+
#### Product
|
|
90
|
+
- `product_id`: Unique product identifier
|
|
91
|
+
- `product_type`: Type of product ("mobile" or "internet")
|
|
92
|
+
- `phone_number`: Phone number (for mobile products)
|
|
93
|
+
- `easy_switch_number`: Easy Switch number (for internet products)
|
|
94
|
+
- `tariff`: Tariff/plan name
|
|
95
|
+
- `contract`: Contract information (Contract object)
|
|
96
|
+
- `usage`: Usage data (UsageData object)
|
|
97
|
+
|
|
98
|
+
#### Contract
|
|
99
|
+
- `start_date`: Contract start date (ISO format)
|
|
100
|
+
- `price_per_month_eur`: Monthly price in EUR
|
|
101
|
+
|
|
102
|
+
#### UsageData
|
|
103
|
+
- `period`: Billing period with start and end dates
|
|
104
|
+
- `data`: Data usage information (used, limit, unlimited)
|
|
105
|
+
- `calls`: Call usage information (used, unlimited)
|
|
106
|
+
- `sms_mms`: SMS/MMS usage information (used, unlimited)
|
|
107
|
+
|
|
108
|
+
#### Invoice
|
|
109
|
+
- `invoice_id`: Invoice identifier
|
|
110
|
+
- `amount_eur`: Invoice amount in EUR
|
|
111
|
+
- `status`: Invoice status
|
|
112
|
+
- `paid`: Whether invoice is paid (boolean)
|
|
113
|
+
- `date`: Invoice date (ISO format)
|
|
114
|
+
- `due_date`: Invoice due date (ISO format)
|
|
115
|
+
|
|
116
|
+
#### AccountData
|
|
117
|
+
- `provider`: Provider name (always "hey!")
|
|
118
|
+
- `last_sync`: Last synchronization timestamp
|
|
119
|
+
- `products`: List of Product objects
|
|
120
|
+
- `latest_invoice`: Latest Invoice object
|
|
121
|
+
|
|
122
|
+
## Example Output
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"provider": "hey!",
|
|
127
|
+
"account": {
|
|
128
|
+
"last_sync": "2025-11-09T15:30:00"
|
|
129
|
+
},
|
|
130
|
+
"products": [
|
|
131
|
+
{
|
|
132
|
+
"id": "mobile_0412345678",
|
|
133
|
+
"type": "mobile",
|
|
134
|
+
"phone_number": "0412 34 56 78",
|
|
135
|
+
"tariff": "Hey! Mobile Plus",
|
|
136
|
+
"contract": {
|
|
137
|
+
"start_date": "2024-01-15",
|
|
138
|
+
"price_per_month_eur": 15.0
|
|
139
|
+
},
|
|
140
|
+
"usage": {
|
|
141
|
+
"period": {
|
|
142
|
+
"start": "2025-10-11",
|
|
143
|
+
"end": "2025-11-11"
|
|
144
|
+
},
|
|
145
|
+
"data": {
|
|
146
|
+
"used": 2.5,
|
|
147
|
+
"limit": 10.0,
|
|
148
|
+
"unlimited": false,
|
|
149
|
+
"last_update": "2025-11-09T14:30:00"
|
|
150
|
+
},
|
|
151
|
+
"calls": {
|
|
152
|
+
"used": 45.0,
|
|
153
|
+
"unlimited": true,
|
|
154
|
+
"last_update": "2025-11-09T14:30:00"
|
|
155
|
+
},
|
|
156
|
+
"sms_mms": {
|
|
157
|
+
"used": 12,
|
|
158
|
+
"unlimited": true,
|
|
159
|
+
"last_update": "2025-11-09T14:30:00"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"billing": {
|
|
165
|
+
"latest_invoice": {
|
|
166
|
+
"invoice_id": "INV-20251101",
|
|
167
|
+
"amount_eur": 15.0,
|
|
168
|
+
"status": "betaald",
|
|
169
|
+
"paid": true,
|
|
170
|
+
"date": "2025-11-01",
|
|
171
|
+
"due_date": "2025-11-15"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Project Structure
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
heytestdev/
|
|
181
|
+
├── src/
|
|
182
|
+
│ └── heytelecom/
|
|
183
|
+
│ ├── __init__.py # Package initialization and exports
|
|
184
|
+
│ ├── client.py # Main HeyTelecomClient class
|
|
185
|
+
│ ├── models.py # Data models (Product, Invoice, etc.)
|
|
186
|
+
│ ├── parsers.py # Parsing utilities
|
|
187
|
+
│ └── installer.py # Playwright installation utilities
|
|
188
|
+
├── README.md # This file
|
|
189
|
+
├── pyproject.toml # Package configuration
|
|
190
|
+
└── .gitignore # Git ignore rules
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Requirements
|
|
194
|
+
|
|
195
|
+
- Python 3.8+
|
|
196
|
+
- playwright
|
|
197
|
+
|
|
198
|
+
## Advanced Usage
|
|
199
|
+
|
|
200
|
+
### Using Saved Sessions
|
|
201
|
+
|
|
202
|
+
After the first login, the browser session is saved. You can use the library without credentials:
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
from heytelecom import HeyTelecomClient
|
|
206
|
+
|
|
207
|
+
with HeyTelecomClient() as client:
|
|
208
|
+
account_data = client.get_account_data()
|
|
209
|
+
print(f"Found {len(account_data.products)} products")
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Getting Specific Data
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
from heytelecom import HeyTelecomClient
|
|
216
|
+
|
|
217
|
+
with HeyTelecomClient() as client:
|
|
218
|
+
# Get only products
|
|
219
|
+
products = client.get_products()
|
|
220
|
+
for product in products:
|
|
221
|
+
print(f"Product: {product.tariff}")
|
|
222
|
+
print(f"Type: {product.product_type}")
|
|
223
|
+
if product.usage:
|
|
224
|
+
print(f"Usage: {product.usage.to_dict()}")
|
|
225
|
+
|
|
226
|
+
# Get only latest invoice
|
|
227
|
+
invoice = client.get_latest_invoice()
|
|
228
|
+
if invoice:
|
|
229
|
+
print(f"Invoice: {invoice.amount_eur} EUR")
|
|
230
|
+
print(f"Status: {invoice.status}")
|
|
231
|
+
print(f"Paid: {invoice.paid}")
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Manual Playwright Installation
|
|
235
|
+
|
|
236
|
+
Playwright chromium is automatically installed on first use. If you prefer manual installation:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# Manual installation (optional)
|
|
240
|
+
playwright install chromium --with-deps --only-shell
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Or use the built-in installer:
|
|
244
|
+
|
|
245
|
+
```python
|
|
246
|
+
from heytelecom import ensure_playwright_installed
|
|
247
|
+
ensure_playwright_installed()
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Disabling Auto-Installation
|
|
251
|
+
|
|
252
|
+
If you prefer to handle Playwright installation manually:
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
from heytelecom import HeyTelecomClient
|
|
256
|
+
|
|
257
|
+
with HeyTelecomClient(auto_install=False) as client:
|
|
258
|
+
account_data = client.get_account_data()
|
|
259
|
+
print(account_data.to_dict())
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Contributing
|
|
263
|
+
|
|
264
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
265
|
+
|
|
266
|
+
## License
|
|
267
|
+
|
|
268
|
+
MIT License
|
|
269
|
+
|
|
270
|
+
## Support
|
|
271
|
+
|
|
272
|
+
For issues and questions, please open an issue on the GitHub repository.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "heytelecom"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A Python library for interacting with Hey Telecom accounts"
|
|
9
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "CoderMauro", email = "mauro.druwel@gmail.com"}
|
|
13
|
+
]
|
|
14
|
+
keywords = ["hey", "telecom", "hey!", "belgium", "mobile", "internet"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.8",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"playwright",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest",
|
|
35
|
+
"pytest-cov",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/maurodruwel/heytelecom"
|
|
40
|
+
Repository = "https://github.com/maurodruwel/heytelecom"
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.packages.find]
|
|
43
|
+
where = ["src"]
|
|
44
|
+
|
|
45
|
+
[project.scripts]
|
|
46
|
+
heytelecom-install = "heytelecom.installer:main"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Hey Telecom Python Library
|
|
3
|
+
|
|
4
|
+
A Python library for interacting with Hey Telecom accounts using Playwright.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
|
|
9
|
+
from .client import HeyTelecomClient
|
|
10
|
+
from .models import Product, Contract, UsageData, Invoice, AccountData
|
|
11
|
+
from .installer import install_playwright, ensure_playwright_installed
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"HeyTelecomClient",
|
|
15
|
+
"Product",
|
|
16
|
+
"Contract",
|
|
17
|
+
"UsageData",
|
|
18
|
+
"Invoice",
|
|
19
|
+
"AccountData",
|
|
20
|
+
"install_playwright",
|
|
21
|
+
"ensure_playwright_installed",
|
|
22
|
+
]
|