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.1.tar.gz (3.1 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.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: g9_api_client-0.0.1.tar.gz
  • Upload date:
  • Size: 3.1 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.1.tar.gz
Algorithm Hash digest
SHA256 d3a47d2cdb05926ff9366d67d5af8fd25da8dec44f46ffe8b23f2625b2e8e841
MD5 11481105e71013b2f4f145c48a3046e1
BLAKE2b-256 fb5753805ab24f995fcc51320b8d9725f92350aa5f83d520e43bce1bd91e2f44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: g9_api_client-0.0.1-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

Hashes for g9_api_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8caaf2a889a7b7bcdaff0cfba8c83cfa8b064082741ea59854291602b2bf782
MD5 475b7d38f65e64bdc19485bf9a268a8a
BLAKE2b-256 141535d461b20d65130ea2b62d25a0b8a1a7fadaadffddb5b5d37ec8a3f18800

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