Sample Scripts

There are a small number of sample scripts that have been written over the years and provide additional information about using pywind.


The names used are probably in need of changing!

Some of the scripts date back several years in origin, so the names may no longer be appropriate!


This script was written to satisfy the following request by a researcher

For a given list of windfarms, get the capacity and RO certificates issued for a given period (or periods), as an Excel spreadsheet

Ofgem were unable to limit their data to the criteria but did supply an Excel spreadsheet of all their data - which was too large to be opened on most computers!

To use this script to get the information for the station Braes of Doune

$ ./ 201601 201603
Enter a station name (or blank to finish)Braes Of Doune
Enter a station name (or blank to finish)

Total of 1 stations to process

     Braes Of Doune

Complete. Generating Excel spreadsheet certificates.xls

When entering station names, you can specify more than one on a line by seperating them with commas, so rerun the above query for the stations Braes of Doune and Boulfruich you could do this

$ ./ --start Jan-2010 --end Dec-2010 --filename two_stations

You can also provide a file with one station name per line, using the –input parameter.

$ cat station.list
Braes Of Doune
$ ./ --input station.list 201601 201603

An Ofgem search is conducted for each station name supplied and all matching stations are added to the list of stations to have their certificate information queried and recorded.

The output is minimal but intended to keep you up to date with progress as searching for stations takes a while.

$ 201601 201603 --stations Griffin
Period covered will be Jan-2016 to Mar-2016. A total of 3 periods
Station names to be searched for:
    - Griffin
Enter a station name (or blank to finish)

Searching for stations...
    - Griffin
A total of 4 stations will be recorded

Getting certificate data (this is quicker)...
    - Griffin Wind Farm
        added to spreadsheet
    - William Griffin 6.0kwp
        nothing to add
    - Griffin PV System
        nothing to add
    - Ronald Griffin Solar Hub
        nothing to add

Data saved to certificates.xls


It would be nice to have better formatting for the output, but as this is just a sample script I haven’t spent any time adding them, e.g. the date format on the exported spreadsheet needs setting.


This sample script was written on behalf of Graham and an enquiry he had for a years worth of output data for Hydro & Biogas stations.

As usual REGO output will be used a proxy for output.

The library appears unable to cope with setting the technology field directly and so we restrict the options setting to the year, month and scheme and then simply filter the returned data.


This script demonstrates how to use the bmreports.UnitData class to get information about Constraint Payments.

It does not attempt to cater for long or short days and simply assumes that there will be 48 settlement periods.