Python library to retrieve information from "G9" portal
Project description
G9 API Client
G9 API Client is a Python library for interacting with the G9 API. It allows you to log in, retrieve contracts, and get the latest invoices and consumption data for electricity and gas.
Installation
You can install the G9 API Client using pip:
pip install g9_api_client
Usage
Here is an example of how to use the G9 API Client:
from g9_api_client import G9
def main():
acc = G9("your_username", "your_password")
if acc.login():
print("Login successful")
contracts = acc.get_contracts()
if contracts:
contract_id = contracts[0].get('id')
print("Contracts:", contracts)
print("Last Invoice:", acc.get_last_invoice(contract_id))
print("Last Electricity Consumption:", acc.get_last_electricity_consumption(contract_id))
print("Last Gas Consumption:", acc.get_last_gas_consumption(contract_id))
else:
print("No contracts found")
else:
print("Login failed")
if __name__ == "__main__":
main()
Methods
login()
Logs in to the G9 API using the provided username and password.
get_contracts()
Retrieves the list of contracts associated with the logged-in user.
get_last_invoice(contract_id)
Retrieves the last invoice for the specified contract.
get_last_electricity_consumption(contract_id)
Retrieves the last electricity consumption data for the specified contract.
get_last_gas_consumption(contract_id)
Retrieves the last gas consumption data for the specified contract.
License
This project is licensed under the Apache 2 License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file g9_api_client-0.0.2.tar.gz.
File metadata
- Download URL: g9_api_client-0.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56c2322ba031663da5341b9e924d10e7c5ecb161c1ab3cdd5849f1003f487d8b
|
|
| MD5 |
8a5add1fc2a15251e7e1b0564e8638fb
|
|
| BLAKE2b-256 |
bd6853c6fa471e929934c7fa540e86be25ae53a5c0b79b7d893437f337528b8d
|
File details
Details for the file g9_api_client-0.0.2-py3-none-any.whl.
File metadata
- Download URL: g9_api_client-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
529556bc1d8b9e97de5b885fe59e5ae6e5c10be3b159f9b6c3a21154927e5874
|
|
| MD5 |
66e873661e53ec23a4118ac60151bb36
|
|
| BLAKE2b-256 |
c2502f4b1a104b1c6e55a1523c92e9aed398c03b2d1b6f0b4b29de0b0bfd92ae
|