October 24, 2023

Eliminate boilerplate and focus on coding: Solcast’s new Python SDK

Newsletter

Find Solcast analysis helpful? Get the latest insights, expertise, and analysis on the solar industry from the Solcast and DNV teams from our newsletter.

Product Updates

Eliminate boilerplate and focus on coding: Solcast’s new Python SDK

Harry Woods

October 24, 2023

Share this post

Introducing the Solcast Python SDK

Solcast data is used in the planning, operations and management of over 300GW of assets globally. Across the hundreds of organisations we work with, there are different and innovative applications of historical and forecast solar irradiance data. To help you with getting data from the Solcast API and get working faster, we built a Python SDK for solar with some straightforward examples. On top of the SDK, our API docs provide the detail you need to build specific requests and get the data you need.

Requesting Solcast data through the API SDK requires an API key, which you can find in your Solcast Toolkit Account. If you are writing code to test the and evaluate our data, you can access data for our unmetered locations for free, use the evaluate access that comes with a Commercial Toolkit account, or Request a Quote through our pricing page to speak with us about an extended evaluation or purchasing access.

What is an API SDK and Who Uses It?

If you’re not familiar, an API Software Development Kit (SDK) is a toolkit designed to make it easier to interact with an API. In simpler terms, think of it as an out of the box connector that helps your code understand the language of our database. It's a tool commonly employed by developers and data scientists to expedite the connection to APIs and diminish the amount of manual setup required to start processing information.

Why Python? What about other languages?

With a vibrant community of over 50,000 users, many of whom work in Python and other languages, we recognise the need to support multiple different languages. We started with Python because it’s the most common language used in solar applications, but we have already built an SDK in Julia, and other languages will be updated on our SDK page as they launch.

Why use the SDK?

Most developers or data scientists working with solar data are familiar with the challenges of time averaging, timezone adjustments, or cleaning data to match measurements with actuals, and the SDK standardises these hygiene issues so you can spend more time on delivering value.

Get Started Faster

We built a synchronous speedy API to deliver the best solar data, and now want to share the SDK code we use to help get you up and running with the API even faster too. We know this code works, and we thought it would save you time to let you use it too.

Stay Focused on your own Code

Everyone hates to waste time on integration instead of building your actual project. Our goal is to let you focus on the work you’re great at, so we built the SDK so you don’t have to worry about implementation.

Eliminating Boilerplate

Our team work with our API every day, so know it’s important to keep your code lightweight. We built the SDK so you have an easy and lightweight way to access the data you need from your python code, whether it’s inside your notebooks or running on your servers

How it works

Our data and API endpoints are built for multiple applications across the solar power generation stack, and depending whether you're operating a large asset, or building technology for residential solar applications, you’ll use it differently.

The Python SDK:

  • Lets you make HTTP requests to the Solcast API using just one Python function call, crafting the url and authentication for you.
  • Helps you get the data you need with less errors, and helpful error messages.
  • Will convert the Solcast API response into a pandas.DataFrame so you can get to analysing the data quicker.
resp = live.radiation_and_weather(    
	latitude=19.3909829, longitude=-99.308764,    
	output_parameters=["ghi","clearsky_ghi"],
	period="PT5M",
	hours=72,
)
resp

resp.to_pandas().plot()

Graph Crop.png

To make it easier to get started, we’ve built example notebooks for common applications of our data.

Example Notebooks:

Introduction to Solcast API SDK Python

Importing Solcast historical data

Importing Solcast TMY data

Connecting Solcast data to pvlib

Aligning timezone and time period

If you’re ready to get started, you can install the SDK from our GitHub repository. Now, you can easily download bankable historical and TMY data and weather forecast API for your solar applications.

Eliminate boilerplate and focus on coding: Solcast’s new Python SDK

Harry Woods

|

Head Of Marketing

Harry is our Head of Marketing, and works with our customers and industry partners to discover and share the new and innovative applications of Solcast data that are being built every day inside the Solar Industry. He holds a Bachelor of Laws and Bachelor of Arts and has experience in Go-To-Market working with complex enterprise grade technology solutions ranging from Ethical AI to Telecommunications.

Newsletter

Find Solcast analysis helpful? Get the latest insights, expertise, and analysis on the solar industry from the Solcast and DNV teams from our newsletter.