Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

te-eg-usage-1.0.1.tar.gz (18.9 kB view details)

Uploaded Source

File details

Details for the file te-eg-usage-1.0.1.tar.gz.

File metadata

  • Download URL: te-eg-usage-1.0.1.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for te-eg-usage-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e4d61ddf0897b536107ed074dd22a02639dae92761a668ed705b503a4b639cb5
MD5 2278d2c4063f4c50f0da3c34d9d8d283
BLAKE2b-256 bfe1a809164f804cc2c16e488bccd3e42f4d9749ec0b0ad077291d20191e2ba7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page