Skip to main content

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

g9_api_client-0.0.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

g9_api_client-0.0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file g9_api_client-0.0.3.tar.gz.

File metadata

  • Download URL: g9_api_client-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for g9_api_client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 98af91e4a7a515076b7b9cb5493fb2134e8104ba30c620ffbf94e67e0026ffe2
MD5 d7a68dad8c4403f128ad2fac168cc037
BLAKE2b-256 cde38c414b488ce9074febf49207ba8d8e03898a954cdeadf9afd14482255435

See more details on using hashes here.

File details

Details for the file g9_api_client-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: g9_api_client-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for g9_api_client-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b1af7488a366c1a97f839c69a1bbae1130ff434d6b470afd32d11785b3c5ace5
MD5 9e5b58d875ba6f9e63c6f6d90365893a
BLAKE2b-256 a2e441c64b2ff5d539d1fd9257bb505a166d3fedae079b80a8d684766b439c59

See more details on using hashes here.

Supported by

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