<!--
*** To avoid retyping too much info. Do a search and replace for the following:
*** github_username, repo_name
-->
## Python API fetching Solarpanels forecast information.
<!-- PROJECT SHIELDS -->
![Project Maintenance][maintenance-shield]
[![License][license-shield]](LICENSE)
[![GitHub Activity][commits-shield]][commits]
[![GitHub Last Commit][last-commit-shield]][commits]
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
## About
With this python library you can request data from [forecast.solar](https://forecast.solar) and see what your solar panels may produce in the coming days.
## Installation
```bash
pip install forecast-solar
```
## Data
This library returns a lot of different data, based on the API:
### Energy
- Total Estimated Energy Production - today/tomorrow (kWh)
- Estimated Energy Production - This Hour (kWh)
- Estimated Energy Production - Next Hour (kWh)
- Estimated Energy Production - Remaining today (kWh)
### Power
- Highest Power Peak Time - Today (datetime)
- Highest Power Peak Time - Tomorrow (datetime)
- Estimated Power Production - Now (W)
- Estimated Power Production - Next Hour (W)
- Estimated Power Production - In +6 Hours (W)
- Estimated Power Production - In +12 Hours (W)
- Estimated Power Production - In +24 Hours (W)
### API Info
- Timezone
- Rate limit
- Account type
- Rate remaining
### Validation
- API key (bool)
- Plane (bool)
## Example
```python
import asyncio
from forecast_solar import ForecastSolar
async def main() -> None:
"""Show example on how to use the library."""
async with ForecastSolar(
api_key="YOUR_API_KEY",
latitude=52.16,
longitude=4.47,
declination=20,
azimuth=10,
kwp=2.160,
damping=0,
damping_morning=0.5,
damping_evening=0.5,
horizon="0,0,0,10,10,20,20,30,30",
) as forecast:
estimate = await forecast.estimate(actual=2.315)
print(estimate)
if __name__ == "__main__":
asyncio.run(main())
```
## ForecastSolar object
| Parameter | value type | Description |
| --------- | ---------- | ----------- |
| `api_key` | `str` | Your API key from [forecast.solar](https://forecast.solar) (optional) |
| `declination` | `int` | The tilt of the solar panels (required) |
| `azimuth` | `int` | The direction the solar panels are facing (required) |
| `kwp` | `float` | The size of the solar panels in kWp (required) |
| `damping` | `float` | The damping of the solar panels, [read this][forecast-damping] for more information (optional) |
| `damping_morning` | `float` | The damping of the solar panels in the morning (optional) |
| `damping_evening` | `float` | The damping of the solar panels in the evening (optional) |
| `inverter` | `float` | The maximum power of your inverter in kilo watts (optional) |
| `horizon` | `str` | A list of **comma separated** degrees values, [read this][forecast-horizon] for more information (optional) |
## estimate() method
| Parameter | value type | Description |
| --------- | ---------- | -------------------------------------------------------------------------------------------------- |
| `actual` | `float` | The production in kWh for the current day so far. Only used when an API key is provided (optional) |
## Contributing
Would you like to contribute to the development of this project? Then read the prepared [contribution guidelines](CONTRIBUTING.md) and go ahead!
Thank you for being involved! :heart_eyes:
## Setting up development environment
This Python project relies on [Poetry][poetry] as its dependency manager,
providing comprehensive management and control over project dependencies.
You need at least:
- Python 3.11+
- [Poetry][poetry-install]
### Installation
Install all packages, including all development requirements:
```bash
poetry install
```
_Poetry creates by default an virtual environment where it installs all
necessary pip packages_.
### Pre-commit
This repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. To setup the pre-commit check, run:
```bash
poetry run pre-commit install
```
And to run all checks and tests manually, use the following command:
```bash
poetry run pre-commit run --all-files
```
### Testing
It uses [pytest](https://docs.pytest.org/en/stable/) as the test framework. To run the tests:
```bash
poetry run pytest
```
To update the [syrupy](https://github.com/tophat/syrupy) snapshot tests:
```bash
poetry run pytest --snapshot-update
```
## License
MIT License
Copyright (c) 2021-2024 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.
<!-- LINKS -->
[forecast-horizon]: https://doc.forecast.solar/doku.php?id=api#horizon
[forecast-damping]: https://doc.forecast.solar/doku.php?id=damping
<!-- MARKDOWN LINKS & IMAGES -->
[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg?style=for-the-badge
[contributors-shield]: https://img.shields.io/github/contributors/home-assistant-libs/forecast_solar.svg?style=for-the-badge
[contributors-url]: https://github.com/home-assistant-libs/forecast_solar/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/home-assistant-libs/forecast_solar.svg?style=for-the-badge
[forks-url]: https://github.com/home-assistant-libs/forecast_solar/network/members
[stars-shield]: https://img.shields.io/github/stars/home-assistant-libs/forecast_solar.svg?style=for-the-badge
[stars-url]: https://github.com/home-assistant-libs/forecast_solar/stargazers
[issues-shield]: https://img.shields.io/github/issues/home-assistant-libs/forecast_solar.svg?style=for-the-badge
[issues-url]: https://github.com/home-assistant-libs/forecast_solar/issues
[license-shield]: https://img.shields.io/github/license/home-assistant-libs/forecast_solar.svg?style=for-the-badge
[commits-shield]: https://img.shields.io/github/commit-activity/y/home-assistant-libs/forecast_solar.svg?style=for-the-badge
[commits]: https://github.com/home-assistant-libs/forecast_solar/commits/master
[last-commit-shield]: https://img.shields.io/github/last-commit/home-assistant-libs/forecast_solar.svg?style=for-the-badge
[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": "https://github.com/home-assistant-libs/forecast_solar",
"name": "forecast-solar",
"maintainer": "Klaas Schoute",
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": "hello@student-techlife.com",
"keywords": "forecast, solar, power, energy, api, async, client",
"author": "Klaas Schoute",
"author_email": "hello@student-techlife.com",
"download_url": "https://files.pythonhosted.org/packages/58/7d/bd66f62caa74ca6404cf438d95690b92da07e13c6f38c4153468f0c4e89a/forecast_solar-4.0.0.tar.gz",
"platform": null,
"description": "<!--\n*** To avoid retyping too much info. Do a search and replace for the following:\n*** github_username, repo_name\n-->\n\n## Python API fetching Solarpanels forecast information.\n<!-- PROJECT SHIELDS -->\n![Project Maintenance][maintenance-shield]\n[![License][license-shield]](LICENSE)\n\n[![GitHub Activity][commits-shield]][commits]\n[![GitHub Last Commit][last-commit-shield]][commits]\n[![Contributors][contributors-shield]][contributors-url]\n\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n\n## About\n\nWith this python library you can request data from [forecast.solar](https://forecast.solar) and see what your solar panels may produce in the coming days.\n\n## Installation\n\n```bash\npip install forecast-solar\n```\n\n## Data\n\nThis library returns a lot of different data, based on the API:\n\n### Energy\n\n- Total Estimated Energy Production - today/tomorrow (kWh)\n- Estimated Energy Production - This Hour (kWh)\n- Estimated Energy Production - Next Hour (kWh)\n- Estimated Energy Production - Remaining today (kWh)\n\n### Power\n\n- Highest Power Peak Time - Today (datetime)\n- Highest Power Peak Time - Tomorrow (datetime)\n- Estimated Power Production - Now (W)\n- Estimated Power Production - Next Hour (W)\n- Estimated Power Production - In +6 Hours (W)\n- Estimated Power Production - In +12 Hours (W)\n- Estimated Power Production - In +24 Hours (W)\n\n### API Info\n\n- Timezone\n- Rate limit\n- Account type\n- Rate remaining\n\n### Validation\n\n- API key (bool)\n- Plane (bool)\n\n## Example\n\n```python\nimport asyncio\n\nfrom forecast_solar import ForecastSolar\n\n\nasync def main() -> None:\n \"\"\"Show example on how to use the library.\"\"\"\n async with ForecastSolar(\n api_key=\"YOUR_API_KEY\",\n latitude=52.16,\n longitude=4.47,\n declination=20,\n azimuth=10,\n kwp=2.160,\n damping=0,\n damping_morning=0.5,\n damping_evening=0.5,\n horizon=\"0,0,0,10,10,20,20,30,30\",\n ) as forecast:\n estimate = await forecast.estimate(actual=2.315)\n print(estimate)\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## ForecastSolar object\n\n| Parameter | value type | Description |\n| --------- | ---------- | ----------- |\n| `api_key` | `str` | Your API key from [forecast.solar](https://forecast.solar) (optional) |\n| `declination` | `int` | The tilt of the solar panels (required) |\n| `azimuth` | `int` | The direction the solar panels are facing (required) |\n| `kwp` | `float` | The size of the solar panels in kWp (required) |\n| `damping` | `float` | The damping of the solar panels, [read this][forecast-damping] for more information (optional) |\n| `damping_morning` | `float` | The damping of the solar panels in the morning (optional) |\n| `damping_evening` | `float` | The damping of the solar panels in the evening (optional) |\n| `inverter` | `float` | The maximum power of your inverter in kilo watts (optional) |\n| `horizon` | `str` | A list of **comma separated** degrees values, [read this][forecast-horizon] for more information (optional) |\n\n## estimate() method\n\n| Parameter | value type | Description |\n| --------- | ---------- | -------------------------------------------------------------------------------------------------- |\n| `actual` | `float` | The production in kWh for the current day so far. Only used when an API key is provided (optional) |\n\n## Contributing\n\nWould you like to contribute to the development of this project? Then read the prepared [contribution guidelines](CONTRIBUTING.md) and go ahead!\n\nThank you for being involved! :heart_eyes:\n\n## Setting up development environment\n\nThis Python project relies on [Poetry][poetry] as its dependency manager,\nproviding comprehensive management and control over project dependencies.\n\nYou need at least:\n\n- Python 3.11+\n- [Poetry][poetry-install]\n\n### Installation\n\nInstall all packages, including all development requirements:\n\n```bash\npoetry install\n```\n\n_Poetry creates by default an virtual environment where it installs all\nnecessary pip packages_.\n\n### Pre-commit\n\nThis repository uses the [pre-commit][pre-commit] framework, all changes\nare linted and tested with each commit. To setup the pre-commit check, run:\n\n```bash\npoetry run pre-commit install\n```\n\nAnd to run all checks and tests manually, use the following command:\n\n```bash\npoetry run pre-commit run --all-files\n```\n\n### Testing\n\nIt uses [pytest](https://docs.pytest.org/en/stable/) as the test framework. To run the tests:\n\n```bash\npoetry run pytest\n```\n\nTo update the [syrupy](https://github.com/tophat/syrupy) snapshot tests:\n\n```bash\npoetry run pytest --snapshot-update\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2021-2024 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<!-- LINKS -->\n[forecast-horizon]: https://doc.forecast.solar/doku.php?id=api#horizon\n[forecast-damping]: https://doc.forecast.solar/doku.php?id=damping\n\n<!-- MARKDOWN LINKS & IMAGES -->\n[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg?style=for-the-badge\n[contributors-shield]: https://img.shields.io/github/contributors/home-assistant-libs/forecast_solar.svg?style=for-the-badge\n[contributors-url]: https://github.com/home-assistant-libs/forecast_solar/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/home-assistant-libs/forecast_solar.svg?style=for-the-badge\n[forks-url]: https://github.com/home-assistant-libs/forecast_solar/network/members\n[stars-shield]: https://img.shields.io/github/stars/home-assistant-libs/forecast_solar.svg?style=for-the-badge\n[stars-url]: https://github.com/home-assistant-libs/forecast_solar/stargazers\n[issues-shield]: https://img.shields.io/github/issues/home-assistant-libs/forecast_solar.svg?style=for-the-badge\n[issues-url]: https://github.com/home-assistant-libs/forecast_solar/issues\n[license-shield]: https://img.shields.io/github/license/home-assistant-libs/forecast_solar.svg?style=for-the-badge\n[commits-shield]: https://img.shields.io/github/commit-activity/y/home-assistant-libs/forecast_solar.svg?style=for-the-badge\n[commits]: https://github.com/home-assistant-libs/forecast_solar/commits/master\n[last-commit-shield]: https://img.shields.io/github/last-commit/home-assistant-libs/forecast_solar.svg?style=for-the-badge\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 for getting forecast solar information",
"version": "4.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/home-assistant-libs/forecast_solar/issues",
"Changelog": "https://github.com/home-assistant-libs/forecast_solar/releases",
"Documentation": "https://github.com/home-assistant-libs/forecast_solar",
"Homepage": "https://github.com/home-assistant-libs/forecast_solar",
"Repository": "https://github.com/home-assistant-libs/forecast_solar"
},
"split_keywords": [
"forecast",
" solar",
" power",
" energy",
" api",
" async",
" client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8fd57b7c03b535f8e3c6022ec10929e2b19e431d3072e6582f517d9083f2b82f",
"md5": "f1b3e146d95180360cf7458ef3e61b50",
"sha256": "555358b3b11667904e6f8ffd8feb131fc53cdfe9b6a4e88c27edf2a6ca09d2e5"
},
"downloads": -1,
"filename": "forecast_solar-4.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f1b3e146d95180360cf7458ef3e61b50",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 10312,
"upload_time": "2024-11-15T12:23:49",
"upload_time_iso_8601": "2024-11-15T12:23:49.809003Z",
"url": "https://files.pythonhosted.org/packages/8f/d5/7b7c03b535f8e3c6022ec10929e2b19e431d3072e6582f517d9083f2b82f/forecast_solar-4.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "587dbd66f62caa74ca6404cf438d95690b92da07e13c6f38c4153468f0c4e89a",
"md5": "a261a30403293e86c6c1a7c8b40cc2fb",
"sha256": "b747c4f680d21cdfd017a86593930b3dc6030ef4288139d6747a3a411cb917c7"
},
"downloads": -1,
"filename": "forecast_solar-4.0.0.tar.gz",
"has_sig": false,
"md5_digest": "a261a30403293e86c6c1a7c8b40cc2fb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 11533,
"upload_time": "2024-11-15T12:23:50",
"upload_time_iso_8601": "2024-11-15T12:23:50.951839Z",
"url": "https://files.pythonhosted.org/packages/58/7d/bd66f62caa74ca6404cf438d95690b92da07e13c6f38c4153468f0c4e89a/forecast_solar-4.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 12:23:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "home-assistant-libs",
"github_project": "forecast_solar",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "forecast-solar"
}