No project description provided
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
Release history Release notifications | RSS feed
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.1.tar.gz
(6.0 kB
view hashes)
Built Distribution
goldenergy-0.0.1-py3-none-any.whl
(10.2 kB
view hashes)
Close
Hashes for goldenergy-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9109400e18eab83d4c9a1feaf940c862192b3ba1a1e4f089c689aeedaeafc8fa |
|
MD5 | a63150a95af15077814dbf29523d3a5c |
|
BLAKE2b-256 | bb403369d932f3ea02cb4c72e4d1ce1f6e8d22f6ee8766de2659831cfedf1e63 |