Welcome to tekuila’s documentation!¶
This is a simple Python library for parsing your ISPs download limits API.
Contents:
Tekuila¶
This is the base class which all ISP implementations inherit from.
-
class
tekuila.tekuila.
Tekuila
(apikey=None, cap=None, warn_ratio=None, verbose=False)[source]¶ Base class for parsing the ISP quota API and act upon the results.
Construct a new fetch/parser to check cap and warn levels.
Parameters: - apikey – API key for ISP
- cap – Your cap in GB
- warn – The ratio you would like a warning to be returned from check_cap in 0.0 to 1.0 ratio.
- verbose – Boolean, True to print output.
-
check_cap
(verbose=False)[source]¶ Check if cap exists, if so check if download total has been exceeded based on fetched results.
Parameters: verbose – Force print and warnings or errors. Returns: True if exceeded False otherwise.
-
check_warn
(verbose=False)[source]¶ If cap and warn limit are set, check if the user has passed the set threshold set in the config file.
Parameters: verbose – Force print any warnings or errors. Returns: True if exceeded, False otherwise.
-
fetch_data
()[source]¶ Child class must implement. Fetches the data from the ISPs API URI and set’s appropriate values see set_download_data.
Supported ISPs¶
All ISP implementations inherit from the base Tekuila class.
TekSavvy¶
-
class
tekuila.isp.teksavvy.
Teksavvy
(apikey=None, cap=None, warn_ratio=None, verbose=False)[source]¶ Bases:
tekuila.tekuila.Tekuila
Parse implementation for TekSavvy API
Start.ca¶
-
class
tekuila.isp.startca.
StartCA
(apikey=None, cap=None, warn_ratio=None, verbose=False)[source]¶ Bases:
tekuila.tekuila.Tekuila
Fetch and parse Start.ca quota API
-
static
b_to_GB
(value)[source]¶ Convert from bytes to GB.
Parameters: value – The value in bytes to convert to GB. Returns: Converted GB value
-
static