goldenergy


Namegoldenergy JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryPython library to retrieve information from "Goldenergy" client portal
upload_time2024-06-25 22:49:34
maintainerNone
docs_urlNone
authorNone
requires_python>=3
licenseApache-2.0
keywords api goldenergy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Goldenergy API

## Installation

    pip install goldenergy

## Usage
```python
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
```bash
$ pip install pytest-asyncio
```
Execute the tests
```bash
$ pytest tests/
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "goldenergy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "api, goldenergy",
    "author": null,
    "author_email": "Jose Rolo <ze.p.rolo@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/62/69/ad58d81cd0a92d7335c05cf0ea73887bcec820b6db28974cccdd7340af00/goldenergy-0.0.2.tar.gz",
    "platform": null,
    "description": "# Goldenergy API\n\n## Installation\n\n    pip install goldenergy\n\n## Usage\n```python\nimport asyncio\nimport aiohttp\nfrom src.goldenergy import Goldenergy\n\n\nasync def main():\n    session = aiohttp.ClientSession()\n\n    goldenergy = Goldenergy(session=session, code=\"<NIF>\", password=\"<PASSWORD>\")\n    print(\"LOGIN: \", await goldenergy.login())\n\n    print(\"CONTRACT: \", await goldenergy.get_contract(\"<CONTRACT_NUMBER>\"))\n\n    print(\"LATEST CONTRACT: \", await goldenergy.get_latest_contract())\n\n    print(\"LAST INVOICE: \", await goldenergy.get_last_invoice(\"<CONTRACT_NUMBER>\"))\n\n    print(\"CONSUMPTIONS: \", await goldenergy.get_last_consumption(\"<CONTRACT_NUMBER>\"))\n\n    await session.close()\n\n\nif __name__ == \"__main__\":\n    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())\n    asyncio.run(main())\n\n```\n\n## Tests\nMake sure pytest asyncio is installed\n```bash\n$ pip install pytest-asyncio\n```\nExecute the tests\n```bash\n$ pytest tests/\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Python library to retrieve information from \"Goldenergy\" client portal",
    "version": "0.0.2",
    "project_urls": null,
    "split_keywords": [
        "api",
        " goldenergy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80860c9fc7c691481ef379d65bfdd4657705c540d56f58fa7d37a962eadd9ea5",
                "md5": "ae0b4950b637a7b66c85d36b4f5753b5",
                "sha256": "d6ee88040ab7f2cbcb24f6c1b7fec8d05dc8b1893ee29c2e3c9c58d0507c2a7c"
            },
            "downloads": -1,
            "filename": "goldenergy-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ae0b4950b637a7b66c85d36b4f5753b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 10275,
            "upload_time": "2024-06-25T22:49:33",
            "upload_time_iso_8601": "2024-06-25T22:49:33.278634Z",
            "url": "https://files.pythonhosted.org/packages/80/86/0c9fc7c691481ef379d65bfdd4657705c540d56f58fa7d37a962eadd9ea5/goldenergy-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6269ad58d81cd0a92d7335c05cf0ea73887bcec820b6db28974cccdd7340af00",
                "md5": "6572d3d4e8eaea518f53fd7b73199b75",
                "sha256": "35f23501354ec40db90bab6c29ac1bf6cffc25fcfa764f0260dcfc89eddaa698"
            },
            "downloads": -1,
            "filename": "goldenergy-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6572d3d4e8eaea518f53fd7b73199b75",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 6468,
            "upload_time": "2024-06-25T22:49:34",
            "upload_time_iso_8601": "2024-06-25T22:49:34.839531Z",
            "url": "https://files.pythonhosted.org/packages/62/69/ad58d81cd0a92d7335c05cf0ea73887bcec820b6db28974cccdd7340af00/goldenergy-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-25 22:49:34",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "goldenergy"
}
        
Elapsed time: 0.40771s