Name | spothinta JSON |
Version |
0.1.1
JSON |
| download |
home_page | |
Summary | Asynchronous Python client providing energy prices from spot-hinta.fi |
upload_time | 2023-05-20 18:22:20 |
maintainer | Sebastian Lövdahl |
docs_url | None |
author | Sebastian Lövdahl |
requires_python | >=3.9,<4.0 |
license | MIT |
keywords |
energy
spothinta
prices
api
async
client
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Spot-Hinta.fi Python client
Asynchronous Python client for the [spot-hinta.fi][spothinta] API.
[![GitHub Release][releases-shield]][releases]
[![Python Versions][python-versions-shield]][pypi]
[![Build Status][build-shield]][build-url]
[![Typing Status][typing-shield]][typing-url]
## About
A Python package with which you can retrieve the energy market prices from [spot-hinta.fi][spothinta].
Based on the [easyEnergy][easyenergy] library by [@klaasnicolaas][klaasnicolaas].
## Installation
```bash
pip install spothinta
```
## Data
This client currently supports getting today's and tomorrow's hourly energy prices. The prices for tomorrow are usually published between 14:00 and 15:00. See [spot-hinta.fi API documentation][spothinta-api-docs] for more information about the available data.
## Example
```python
import asyncio
from datetime import date
from spothinta import SpotHinta
async def main() -> None:
"""Show example on fetching the energy prices from spot-hinta.fi."""
async with SpotHinta() as client:
energy = await client.energy_prices()
if __name__ == "__main__":
asyncio.run(main())
```
## Contributing
This is an active open-source project. We are always open to people who want to
use the code or contribute to it.
We've set up a separate document for our
[contribution guidelines](CONTRIBUTING.md).
Thank you for being involved! :heart_eyes:
## Setting up development environment
This Python project is fully managed using the [Poetry][poetry] dependency
manager.
You need at least:
- Python 3.9+
- [Poetry][poetry-install]
Install all packages, including all development requirements:
```bash
poetry install
```
Poetry creates by default an virtual environment where it installs all
necessary pip packages, to enter or exit the venv run the following commands:
```bash
poetry shell
exit
```
Setup the pre-commit check, you must run this inside the virtual environment:
```bash
pre-commit install
```
*Now you're all set to get started!*
As this repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. You can run all checks and tests
manually using the following command:
```bash
poetry run pre-commit run --all-files
```
To run just the Python tests:
```bash
poetry run pytest
```
## License
MIT License
Copyright (c) 2022-2023 Sebastian Lövdahl, Klaas Schoute
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
<!-- MARKDOWN LINKS & IMAGES -->
[easyenergy]: https://github.com/klaasnicolaas/python-easyenergy
[spothinta]: https://spot-hinta.fi/
[spothinta-api-docs]: https://api.spot-hinta.fi/swagger/ui#/(JSON)%20Price%20today%20and%20tomorrow%20(if%20tomorrow%20prices%20exist)/TodayAndDayForward
[klaasnicolaas]: https://github.com/klaasnicolaas
[build-shield]: https://github.com/slovdahl/python-spothinta/actions/workflows/tests.yaml/badge.svg
[build-url]: https://github.com/slovdahl/python-spothinta/actions/workflows/tests.yaml
[code-quality-shield]: https://github.com/slovdahl/python-spothinta/actions/workflows/codeql.yaml/badge.svg
[code-quality]: https://github.com/slovdahl/python-spothinta/actions/workflows/codeql.yaml
[codecov-shield]: https://codecov.io/gh/slovdahl/python-spothinta/branch/main/graph/badge.svg?token=RYhiDUamT6
[codecov-url]: https://codecov.io/gh/slovdahl/python-spothinta
[maintainability-shield]: https://api.codeclimate.com/v1/badges/8628757a4bde52dbfaf6/maintainability
[maintainability-url]: https://codeclimate.com/github/slovdahl/python-spothinta/maintainability
[pypi]: https://pypi.org/project/easyenergy/
[python-versions-shield]: https://img.shields.io/pypi/pyversions/easyenergy
[typing-shield]: https://github.com/slovdahl/python-spothinta/actions/workflows/typing.yaml/badge.svg
[typing-url]: https://github.com/slovdahl/python-spothinta/actions/workflows/typing.yaml
[releases-shield]: https://img.shields.io/github/release/slovdahl/python-spothinta.svg
[releases]: https://github.com/slovdahl/python-spothinta/releases
[poetry-install]: https://python-poetry.org/docs/#installation
[poetry]: https://python-poetry.org
[pre-commit]: https://pre-commit.com
Raw data
{
"_id": null,
"home_page": "",
"name": "spothinta",
"maintainer": "Sebastian L\u00f6vdahl",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "sebastian.lovdahl@hibox.fi",
"keywords": "energy,spothinta,prices,api,async,client",
"author": "Sebastian L\u00f6vdahl",
"author_email": "sebastian.lovdahl@hibox.fi",
"download_url": "https://files.pythonhosted.org/packages/36/9f/6e2f2fee6affc0414fdb3a606abc2e1acb2cd9cc4141d9381801a6dcd44f/spothinta-0.1.1.tar.gz",
"platform": null,
"description": "# Spot-Hinta.fi Python client\n\nAsynchronous Python client for the [spot-hinta.fi][spothinta] API.\n\n[![GitHub Release][releases-shield]][releases]\n[![Python Versions][python-versions-shield]][pypi]\n\n[![Build Status][build-shield]][build-url]\n[![Typing Status][typing-shield]][typing-url]\n\n## About\n\nA Python package with which you can retrieve the energy market prices from [spot-hinta.fi][spothinta].\n\nBased on the [easyEnergy][easyenergy] library by [@klaasnicolaas][klaasnicolaas].\n\n## Installation\n\n```bash\npip install spothinta\n```\n\n## Data\n\nThis client currently supports getting today's and tomorrow's hourly energy prices. The prices for tomorrow are usually published between 14:00 and 15:00. See [spot-hinta.fi API documentation][spothinta-api-docs] for more information about the available data.\n\n## Example\n\n```python\nimport asyncio\n\nfrom datetime import date\nfrom spothinta import SpotHinta\n\n\nasync def main() -> None:\n \"\"\"Show example on fetching the energy prices from spot-hinta.fi.\"\"\"\n async with SpotHinta() as client:\n energy = await client.energy_prices()\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## Contributing\n\nThis is an active open-source project. We are always open to people who want to\nuse the code or contribute to it.\n\nWe've set up a separate document for our\n[contribution guidelines](CONTRIBUTING.md).\n\nThank you for being involved! :heart_eyes:\n\n## Setting up development environment\n\nThis Python project is fully managed using the [Poetry][poetry] dependency\nmanager.\n\nYou need at least:\n\n- Python 3.9+\n- [Poetry][poetry-install]\n\nInstall all packages, including all development requirements:\n\n```bash\npoetry install\n```\n\nPoetry creates by default an virtual environment where it installs all\nnecessary pip packages, to enter or exit the venv run the following commands:\n\n```bash\npoetry shell\nexit\n```\n\nSetup the pre-commit check, you must run this inside the virtual environment:\n\n```bash\npre-commit install\n```\n\n*Now you're all set to get started!*\n\nAs this repository uses the [pre-commit][pre-commit] framework, all changes\nare linted and tested with each commit. You can run all checks and tests\nmanually using the following command:\n\n```bash\npoetry run pre-commit run --all-files\n```\n\nTo run just the Python tests:\n\n```bash\npoetry run pytest\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2022-2023 Sebastian L\u00f6vdahl, Klaas Schoute\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n<!-- MARKDOWN LINKS & IMAGES -->\n[easyenergy]: https://github.com/klaasnicolaas/python-easyenergy\n[spothinta]: https://spot-hinta.fi/\n[spothinta-api-docs]: https://api.spot-hinta.fi/swagger/ui#/(JSON)%20Price%20today%20and%20tomorrow%20(if%20tomorrow%20prices%20exist)/TodayAndDayForward\n[klaasnicolaas]: https://github.com/klaasnicolaas\n\n[build-shield]: https://github.com/slovdahl/python-spothinta/actions/workflows/tests.yaml/badge.svg\n[build-url]: https://github.com/slovdahl/python-spothinta/actions/workflows/tests.yaml\n[code-quality-shield]: https://github.com/slovdahl/python-spothinta/actions/workflows/codeql.yaml/badge.svg\n[code-quality]: https://github.com/slovdahl/python-spothinta/actions/workflows/codeql.yaml\n[codecov-shield]: https://codecov.io/gh/slovdahl/python-spothinta/branch/main/graph/badge.svg?token=RYhiDUamT6\n[codecov-url]: https://codecov.io/gh/slovdahl/python-spothinta\n[maintainability-shield]: https://api.codeclimate.com/v1/badges/8628757a4bde52dbfaf6/maintainability\n[maintainability-url]: https://codeclimate.com/github/slovdahl/python-spothinta/maintainability\n[pypi]: https://pypi.org/project/easyenergy/\n[python-versions-shield]: https://img.shields.io/pypi/pyversions/easyenergy\n[typing-shield]: https://github.com/slovdahl/python-spothinta/actions/workflows/typing.yaml/badge.svg\n[typing-url]: https://github.com/slovdahl/python-spothinta/actions/workflows/typing.yaml\n[releases-shield]: https://img.shields.io/github/release/slovdahl/python-spothinta.svg\n[releases]: https://github.com/slovdahl/python-spothinta/releases\n\n[poetry-install]: https://python-poetry.org/docs/#installation\n[poetry]: https://python-poetry.org\n[pre-commit]: https://pre-commit.com\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Asynchronous Python client providing energy prices from spot-hinta.fi",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"energy",
"spothinta",
"prices",
"api",
"async",
"client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4fce336cbea5f7a3a976ec9faea9f62be79dc4c4f274c91170dca34e7ef5cbb3",
"md5": "c741c1f6c86f2144d09b48e0db603e71",
"sha256": "fe4c008bb63c7f311d38748f8aaf48fcc2487c830a3a6484dd0c57ebd7599f25"
},
"downloads": -1,
"filename": "spothinta-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c741c1f6c86f2144d09b48e0db603e71",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 8666,
"upload_time": "2023-05-20T18:22:19",
"upload_time_iso_8601": "2023-05-20T18:22:19.013654Z",
"url": "https://files.pythonhosted.org/packages/4f/ce/336cbea5f7a3a976ec9faea9f62be79dc4c4f274c91170dca34e7ef5cbb3/spothinta-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "369f6e2f2fee6affc0414fdb3a606abc2e1acb2cd9cc4141d9381801a6dcd44f",
"md5": "db15d55a5e872cfea546b6cac07ce7ba",
"sha256": "fd19eaef93a8d0f81ebcd7df7dfdb3394be7fb18cc359f6019f69faa839a8aef"
},
"downloads": -1,
"filename": "spothinta-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "db15d55a5e872cfea546b6cac07ce7ba",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 9384,
"upload_time": "2023-05-20T18:22:20",
"upload_time_iso_8601": "2023-05-20T18:22:20.666344Z",
"url": "https://files.pythonhosted.org/packages/36/9f/6e2f2fee6affc0414fdb3a606abc2e1acb2cd9cc4141d9381801a6dcd44f/spothinta-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-20 18:22:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "spothinta"
}