pywind.decc
¶
Note
Following the July 2016 announcements of changes in the organisation of government departments, the future of the DECC website is uncertain. While the data provided is likely still be available the module may need adjusting to continue functioning.
pywind.decc.Report
¶
The DECC publish monthly extracts of planning applications for renewable projects. This module aims to make accessing this report simpler.
https://www.gov.uk/government/publications/renewable-energy-planning-database-monthly-extract
-
class
pywind.decc.extract.
DeccRecord
(app_info)[source]¶ Bases:
object
Simple class to hold details of one DECC station.
-
BOOLEAN_FIELDS
= ('chp_enabled', 'green_belt', 'national_park', 'aonb', 'heritage_coast', 'special_landscape_area', 'employment_use', 'natural_environment', 'other_land_use', 'built_heritage__archaeology', 'project_specific', 'chp')¶
-
DATE_FIELDS
= ('record_last_updated_dd_mm_yyyy', 'planning_application_submitted', 'planning_application_withdrawn', 'planning_permission_refused', 'appeal_lodged', 'appeal_withdrawn', 'appeal_refused', 'appeal_granted', 'planning_permission_granted', 'planning_permission_granted', 'record_last_updated_dd_mm_yyyy', 'secretary_of_state___intervened', 'secretary_of_state___refusal', 'secretary_of_state___granted', 'planning_permission_expired', 'under_construction', 'operational')¶
-
FLOAT_FIELDS
= ('installed_capacity_mwelec', 'ro_banding_roc_mwh', 'fit_tariff_p_kwh', 'cfd_capacity_mw', 'turbine_capacity_mw', 'height_of_turbines_m')¶
-
INT_FIELDS
= ('ref_id', 'no._of_turbines', 'x-coordinate', 'y-coordinate')¶
-
-
class
pywind.decc.extract.
MonthlyExtract
(filename=None)[source]¶ Bases:
object
The MonthlyExtract class allows the current monthly data to be easily retrieved and parsed.
Note
The CSV data returned does not declare an encoding, so latin1 is presently assumed.
-
BASE_URL
= 'https://www.gov.uk'¶
-
URL
= 'https://www.gov.uk/government/publications/renewable-energy-planning-database-monthly-extract'¶
-
get_data
()[source]¶ Get the data from the DECC server and parse it into DECC records.
Returns: True or False Return type: bool
-
pywind.decc.geo
¶
The Ordnane Survey publishes a comprehensive document on their co-ordinate systems which is available at
https://www.ordnancesurvey.co.uk/docs/support/guide-coordinate-systems-great-britain.pdf
The conversion routines used in the Coord class are from blog posts by Hannah Fry and remain her copyright.
- http://www.hannahfry.co.uk/blog/2012/02/01/converting-latitude-and-longitude-to-british-national-grid
- http://www.hannahfry.co.uk/blog/2012/02/01/converting-british-national-grid-to-latitude-and-longitude-ii
-
class
pywind.decc.geo.
Coord
(e_or_lat, n_or_lon)[source]¶ Bases:
object
Each instance of the Coord class represents a single co-ordinate, which can be craeted using either WGS84 or OSGB36. Conversions between the 2 systems are done as needed on demand.
-
__init__
(e_or_lat, n_or_lon)[source]¶ Create the object with the initial point. Values should be supplied as float values, but integers can also be used. Providing anything else will result in a ValueError exception.
Parameters: - e_or_lat – Either the Easting or Latitude.
- n_or_lon – Either the Northing or Longitude
Raises: ValueError
-
pywind.decc.utils
¶
-
pywind.decc.utils.
decimal_to_degrees
(num, seps=None)[source]¶ Given a float value and an optional set of seperators, return a formatted string.
If the seperator has a precision value required that differs from the default of 2, then it should be prefixed with a colon, e.g. 3:$ would give a seperator of a $ character after a 3 digit number.
Parameters: - num – The float value to parse
- seps – An optional list of seperators to use.