Skip to main content

Python API fetching Solarpanels forecast information.

Project Maintenance License

GitHub Activity GitHub Last Commit Contributors

Forks Stargazers Issues

About

With this python library you can request data from forecast.solar and see what your solar panels may produce in the coming days.

Installation

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

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()
        print(estimate)


if __name__ == "__main__":
    asyncio.run(main())
Parameter value type Description
api_key str Your API key from 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 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 for more information (optional)

Contributing

Would you like to contribute to the development of this project? Then read the prepared contribution guidelines and go ahead!

Thank you for being involved! :heart_eyes:

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forecast_solar-3.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forecast_solar-3.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file forecast_solar-3.1.0.tar.gz.

File metadata

  • Download URL: forecast_solar-3.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for forecast_solar-3.1.0.tar.gz
Algorithm Hash digest
SHA256 9485ec216ef4fbe140f87835572199dc47644a4aca93d8224c89dce826d8243f
MD5 1f37e7637c7fb1ddcc646a38d7edebd9
BLAKE2b-256 a8d58b360d690fe4cdd18ccff67f5233cb36212184ecb02da672ea2aad424d8a

See more details on using hashes here.

File details

Details for the file forecast_solar-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: forecast_solar-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for forecast_solar-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5b3e4dfb60fa35877edd3e9306cf02a40b979f1cc66e7fbdb3cb1a8ee647980
MD5 eef5c9c502b1bf3ec3e5c872f7f5eb98
BLAKE2b-256 59a8e989f2563f4d2d587ef369069883c96fa76c38d20af3c78892390e057d79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page