Degree Days.net API Python Client Library¶
This Python library makes it easy to use the Degree Days.net API from Python, providing programmatic access to heating and cooling degree days, hourly temperatures, and regression analysis.
Modules¶
The module-name links below lead to details of the classes in each module.
Core Degree Days.net API classes, including |
|
For specifying and receiving degree-day data and temperature data from the API. |
|
Implementations of abstract types from degreedays.api.data. |
|
For using the API to run regressions against your energy-usage data. |
|
Classes for handling geographic information like longitude/latitude positions and distances. |
|
Classes for working with dates and date-ranges in the context of degree days and energy data. |
Index of all classes, properties, and methods¶
See the full index for a list of all classes, properties, and methods. You can also use the search box on every page to find the docs for any class, property, or method.
Where to start?¶
The Python quick-start guide is a good starting place, if you haven’t seen it already. And, before starting serious development, it’s well worth reading the higher-level integration guide as that gives a lot of practical advice on how best to approach integrating with the Degree Days.net API. Developers who read it thoroughly typically save a lot of time in the long run!
The detailed Python API docs here are mostly useful for looking up specific classes, properties, or methods you’re working with. But, if you want to use them to get a really deep understanding of the API and all its options, we suggest you start with the docs for degreedays.api.DegreeDaysApi
.
Collection types used throughout this library¶
This library includes a number of methods and properties that accept or return standard Python collection types. If your project uses type hints, you can import these collection types from the collections.abc
module in Python 3.9 or later. For Python 3.5 to 3.8, import them from the typing
module instead. If your project doesn’t use type hints, or you avoid assigning these collection types to variables, you won’t need to import them at all.
Either way, here are some simple guidelines on how to use these collection types:
Collection
: if a property or method returns aCollection
, you can think of it like a list that you can loop over, check the size of (withlen(col)
), and check for specific items (e.g.item in col
), but the order of items is not guaranteed, and you cannot access items by index.Iterable
: when a method takes anIterable
, you can pass in a list, tuple, set, or anything else that can be iterated over.Mapping
: when a method takes aMapping
, you can pass in a dict.Sequence
: when a method takes aSequence
, you can pass in a list or a tuple. If a property or method returns aSequence
, you can treat it like it’s a list. You can loop over it, check the size of it (withlen(seq)
), test for items within it (e.g.item in seq
), and access it by index (e.g.seq[1]
). The order of items is fixed and significant.
Intersphinx support¶
This documentation supports Intersphinx, making it easy to link to from other Sphinx-based projects.
To enable it, add the following to your Sphinx ‘’conf.py’’:
intersphinx_mapping = {
"degreedays": ("https://python.degreedays.net/", None),
}