Skip to main content

te-eg-usage

Telecom Egypt Usage - Selenium simple scraper to get your data usage info

PyPI Version PyPI License PyPI Downloads

Get your Telecom Egypt account data usage info from my.te.eg website directly from
Python or through the Command-Line Interface entry point. Get what you own
and know why your data is being stolen.

Installation

You will need a webdriver for selenium to run te-eg-usage
Read this for instructions on how to install one.

Using PyPi

pip install te-eg-usage

Manual installation

git clone https://github.com/FaresAhmedb/te-eg-usage.git
cd te-eg-usage && python setup.py install --user

Usage

Command-Line Interface

First we will have to set enviroment variables for the entry point to access and use to log-in

OS X & Linux:

$ export WE_MOBILE_NUMBER=XXXXXXXXXX
$ export WE_PASSWORD=XXXXXXXX

Windows:

> set WE_MOBILE_NUMBER=XXXXXXXXXX
> set WE_PASSWORD=XXXXXXXX

Now you can use it!

$ te-eg-usage
{
    "data_timestamp": 1622923340.4587903,
    "consumed": 39.1,
    "remaining": 100.9,
    "start_date": "2021-06-02",
    "renewal_date": "2021-07-02",
    "remaining_days": 27,
    "renewal_cost": 120.0
}

CLI Arguments

$ # To use a specific webdriver. firefox-headless is the default
$ te-eg-usage --browser BROWSERNAME
$ # Avillable webdrivers are firefox, firefox-headless, chrome, chrome-headless, edge
$
$ # For debug mode
$ te-eg-usage --debug
$
$ # To get a dict Python object instead of JSON
$ te-eg-usage
$
$ # Everything demo
$ te-eg-usage --debug --dict --browser chrome

Pytohn

`This snippet will get you started

from te_eg_usage import TeEgUsage

usage_data_scraper = TeEgUsage(
    mobile_number="XXXXXXXXXX",
    password="XXXXXXXX",
    browser_name="chrome",
)

usage_data = usage_data_scraper.run() # .run(data_type="json") for json

print("\n".join("{}\t{}".format(k, v) for k, v in usage_data.items()))

# output:
# data_timestamp  1622923340.4587903
# consumed        40.0
# remaining       100.0
# start_date      YYYY-MM-DD
# renewal_date    YYYY-MM-DD
# remaining_days  DD
# renewal_cost    120.0

Release History

  • 1.0.0
    • The Release

Meta

fares ahmed faresahmed@zohomail.com

Distributed under the GPLv3 license. See LICENSE for more information.

https://github.com/faresahmedb/te-eg-usage

Contributing

  1. Fork it (https://github.com/faresahmedb/te-eg-usage/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Release files for te-eg-usage 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for te-eg-usage 1.0.1
File Size Uploaded
te-eg-usage-1.0.1.tar.gz 18.9 kB Details

Release files / te-eg-usage-1.0.1.tar.gz

Download URL te-eg-usage-1.0.1.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e4d61ddf0897b536107ed074dd22a02639dae92761a668ed705b503a4b639cb5
BLAKE2b-256 checksum
How to use checksums
bfe1a809164f804cc2c16e488bccd3e42f4d9749ec0b0ad077291d20191e2ba7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page