spothinta-api


Namespothinta-api JSON
Version 0.5.0 PyPI version JSON
download
home_page
SummaryAsynchronous Python client providing energy prices from spot-hinta.fi
upload_time2024-02-01 18:31:44
maintainerSebastian Lövdahl
docs_urlNone
authorSebastian Lövdahl
requires_python>=3.10,<4.0
licenseMIT
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-api
```

## 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.10+
- [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-api",
    "maintainer": "Sebastian L\u00f6vdahl",
    "docs_url": null,
    "requires_python": ">=3.10,<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/43/a3/f7cacb429d3d0ffebdaa9c37eee62d5007760f631d091e69f30b78ccff8a/spothinta_api-0.5.0.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-api\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.10+\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.5.0",
    "project_urls": null,
    "split_keywords": [
        "energy",
        "spothinta",
        "prices",
        "api",
        "async",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46dd92b453bb21d00f05018db7b137bf55f752206700a3ce38a5c907f744ac45",
                "md5": "63ce52f5e9de5dbaf040f457dc724908",
                "sha256": "e8caa912a16a441c09fee8e72b4e2755462c640efdd988f11a703ea45ad01422"
            },
            "downloads": -1,
            "filename": "spothinta_api-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63ce52f5e9de5dbaf040f457dc724908",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 9477,
            "upload_time": "2024-02-01T18:31:42",
            "upload_time_iso_8601": "2024-02-01T18:31:42.376972Z",
            "url": "https://files.pythonhosted.org/packages/46/dd/92b453bb21d00f05018db7b137bf55f752206700a3ce38a5c907f744ac45/spothinta_api-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "43a3f7cacb429d3d0ffebdaa9c37eee62d5007760f631d091e69f30b78ccff8a",
                "md5": "e88eb03fb8e100fd83708af4fcb64312",
                "sha256": "31be49d04551e477a7b97479156a5453246f8cc7471c6fa7396e3915346dabc5"
            },
            "downloads": -1,
            "filename": "spothinta_api-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e88eb03fb8e100fd83708af4fcb64312",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 10068,
            "upload_time": "2024-02-01T18:31:44",
            "upload_time_iso_8601": "2024-02-01T18:31:44.227609Z",
            "url": "https://files.pythonhosted.org/packages/43/a3/f7cacb429d3d0ffebdaa9c37eee62d5007760f631d091e69f30b78ccff8a/spothinta_api-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-01 18:31:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "spothinta-api"
}
        
Elapsed time: 0.18863s