Skip to main content

Python library to retrieve information from "Goldenergy" client portal

Project description

Goldenergy API

Installation

pip install goldenergy

Usage

import asyncio
import aiohttp
from src.goldenergy import Goldenergy


async def main():
    session = aiohttp.ClientSession()

    goldenergy = Goldenergy(session=session, code="<NIF>", password="<PASSWORD>")
    print("LOGIN: ", await goldenergy.login())

    print("CONTRACT: ", await goldenergy.get_contract("<CONTRACT_NUMBER>"))

    print("LATEST CONTRACT: ", await goldenergy.get_latest_contract())

    print("LAST INVOICE: ", await goldenergy.get_last_invoice("<CONTRACT_NUMBER>"))

    print("CONSUMPTIONS: ", await goldenergy.get_last_consumption("<CONTRACT_NUMBER>"))

    await session.close()


if __name__ == "__main__":
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
    asyncio.run(main())

Tests

Make sure pytest asyncio is installed

$ pip install pytest-asyncio

Execute the tests

$ pytest tests/

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

goldenergy-0.0.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

goldenergy-0.0.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file goldenergy-0.0.2.tar.gz.

File metadata

  • Download URL: goldenergy-0.0.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for goldenergy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 35f23501354ec40db90bab6c29ac1bf6cffc25fcfa764f0260dcfc89eddaa698
MD5 6572d3d4e8eaea518f53fd7b73199b75
BLAKE2b-256 6269ad58d81cd0a92d7335c05cf0ea73887bcec820b6db28974cccdd7340af00

See more details on using hashes here.

File details

Details for the file goldenergy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: goldenergy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for goldenergy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d6ee88040ab7f2cbcb24f6c1b7fec8d05dc8b1893ee29c2e3c9c58d0507c2a7c
MD5 ae0b4950b637a7b66c85d36b4f5753b5
BLAKE2b-256 80860c9fc7c691481ef379d65bfdd4657705c540d56f58fa7d37a962eadd9ea5

See more details on using hashes here.

Supported by

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