Extracts invoices from the TPG website.
Project description
Extracts tax invoices from the TPG Cyberstore (My Account) at the command line.
This is useful for automatically grabbing tax invoices.
This has only been tested with a fixed broadband service. It has not been tested with other products (eg: mobile, dial-up).
This is software is not written or endorsed by TPG.
Installing
The easiest way to install tpg_invoice is:
$ pip3 install tpg_invoice
Manual installation
tpg_invoice requires the following:
* Python 3 (tested on 3.6) * BeautifulSoup4 * requests
In Debian based distributions, install these packages:
apt install python3 python3-requests python3-bs4
Then run:
./setup.py install
Authentication
tpg_invoice supports authentication with a username and password, or a pre-existing session cookie. One of the mechanisms must be specified.
Authenticating with a username and password
Usage:
$ tpg_invoice -s ~/.config/tpg.secrets
tpg.secrets is a text file, with two lines:
TPG username.
Account password.
An example secrets file is given below, where the username is exampleuser and their password is correcthorsebatterystaple:
exampleuser correcthorsebatterystaple
Make sure to keep this file only readable by the user which tpg_invoice runs as.
Rate limits apply to the login form, even when login was successful.
Usage
Get invoice list: tpg_invoice list
Usage:
$ tpg_invoice -s tpg.secrets list Invoice list: I178018865: raised 2018-01-01, $59.99 I184856374: raised 2018-02-01, $59.99 [...]
Get specific invoice(s): tpg_invoice get I...
Returns a specific invoice as HTML:
$ tpg_invoice -s tpg.secrets get I178018865 <div class="iaspage-area">Tax Invoice Display<table align="RIGHT"><!--/home/database/cgi-bin/inv_disp.cgi:153--><tr><td align="RIGHT">TPG Internet Pty Ltd ABN 15 068 383 737</td></tr><tr><td align="RIGHT">65 Waterloo Rd, MACQUARIE PARK, NSW, 2113</td></tr></table> [...]
Multiple invoice IDs may be specified at the command line. They will be shown separated by a blank line:
$ tpg_invoice -s tpg.secrets get I178018865 I184856374 <div class="iaspage-area">Tax Invoice Display<table align="RIGHT"><!--/home/database/cgi-bin/inv_disp.cgi:153--><tr><td align="RIGHT">TPG Internet Pty Ltd ABN 15 068 383 737</td></tr><tr><td align="RIGHT">65 Waterloo Rd, MACQUARIE PARK, NSW, 2113</td></tr></table> [...] <div class="iaspage-area">Tax Invoice Display<table align="RIGHT"><!--/home/database/cgi-bin/inv_disp.cgi:153--><tr><td align="RIGHT">TPG Internet Pty Ltd ABN 15 068 383 737</td></tr><tr><td align="RIGHT">65 Waterloo Rd, MACQUARIE PARK, NSW, 2113</td></tr></table> [...]
Get the latest invoice: tpg_invoice get --latest
Returns the latest, non-$0 invoice as HTML:
$ tpg_invoice -s tpg.secrets get --latest <div class="iaspage-area">Tax Invoice Display<table align="RIGHT"><!--/home/database/cgi-bin/inv_disp.cgi:153--><tr><td align="RIGHT">TPG Internet Pty Ltd ABN 15 068 383 737</td></tr><tr><td align="RIGHT">65 Waterloo Rd, MACQUARIE PARK, NSW, 2113</td></tr></table> [...]
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
File details
Details for the file tpg_invoice-0.1.3.tar.gz
.
File metadata
- Download URL: tpg_invoice-0.1.3.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d9b46d69cb9d4bcdcb7ed77298dc1aac9bc81a9ae1e7b676de41e4b3998ad82 |
|
MD5 | 4db794932a0e1f16527770740ea538b0 |
|
BLAKE2b-256 | 6dd06e72c38a7872bc8a309ed2fa9262586bddff04750709657f1785c8f4457e |
File details
Details for the file tpg_invoice-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: tpg_invoice-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 277bfc309ed8cc331a5ee3a8ed65333aa9383d774a6d406e3bab253f2b167387 |
|
MD5 | ce8351f1f1a0af04f019ddf5fa57c545 |
|
BLAKE2b-256 | 4bcf6fc00a10874bc3a77a75808629329cf33da66b0babb40fe735cf5872bca9 |