pyowm.pollutionapi30 package¶
Subpackages¶
Submodules¶
pyowm.pollutionapi30.airpollution_client module¶
pyowm.pollutionapi30.coindex module¶
Carbon Monoxide classes and data structures.
-
class
pyowm.pollutionapi30.coindex.
COIndex
(reference_time, location, interval, co_samples, reception_time)[source]¶ Bases:
object
A class representing the Carbon monOxide Index observed in a certain location in the world. The index is made up of several measurements, each one at a different atmospheric pressure. The location is represented by the encapsulated Location object.
Parameters: - reference_time (int) – GMT UNIXtime telling when the CO data has been measured
- location (Location) – the Location relative to this CO observation
- interval (str) – the time granularity of the CO observation
- co_samples (list of dicts) – the CO samples
- reception_time (int) – GMT UNIXtime telling when the CO observation has been received from the OWM Weather API
Returns: an COIndex instance
Raises: ValueError when negative values are provided as reception time, CO samples are not provided in a list
-
get_co_sample_with_highest_vmr
()[source]¶ Returns the CO sample with the highest Volume Mixing Ratio value :return: dict
-
get_co_sample_with_lowest_vmr
()[source]¶ Returns the CO sample with the lowest Volume Mixing Ratio value :return: dict
-
get_interval
()[source]¶ Returns the time granularity interval for this CO index measurement
Returns: str
-
get_location
()[source]¶ Returns the Location object for this CO index measurement
Returns: the Location object
-
get_reception_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the CO observation has been received from the OWM Weather API
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
get_reference_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the CO samples have been measured
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
is_forecast
()[source]¶ Tells if the current CO observation refers to the future with respect to the current date :return: bool
-
to_XML
(xml_declaration=True, xmlns=True)[source]¶ Dumps object fields to an XML-formatted string. The ‘xml_declaration’ switch enables printing of a leading standard XML line containing XML version and encoding. The ‘xmlns’ switch enables printing of qualified XMLNS prefixes.
Parameters: - XML_declaration (bool) – if
True
(default) prints a leading XML declaration line - xmlns (bool) – if
True
(default) prints full XMLNS prefixes
Returns: an XML-formatted string
- XML_declaration (bool) – if
pyowm.pollutionapi30.ozone module¶
-
class
pyowm.pollutionapi30.ozone.
Ozone
(reference_time, location, interval, du_value, reception_time)[source]¶ Bases:
object
A class representing the Ozone (O3) data observed in a certain location in the world. The location is represented by the encapsulated Location object.
Parameters: - reference_time (int) – GMT UNIXtime telling when the O3 data have been measured
- location (Location) – the Location relative to this O3 observation
- du_value (float) – the observed O3 Dobson Units value (reference: http://www.theozonehole.com/dobsonunit.htm)
- interval (str) – the time granularity of the O3 observation
- reception_time (int) – GMT UNIXtime telling when the observation has been received from the OWM Weather API
Returns: an Ozone instance
Raises: ValueError when negative values are provided as reception time or du_value
-
get_location
()[source]¶ Returns the Location object for this O3 observation
Returns: the Location object
-
get_reception_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the O3 observation has been received from the OWM Weather API
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
get_reference_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the O3 data have been measured
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
is_forecast
()[source]¶ Tells if the current O3 observation refers to the future with respect to the current date :return: bool
-
to_XML
(xml_declaration=True, xmlns=True)[source]¶ Dumps object fields to an XML-formatted string. The ‘xml_declaration’ switch enables printing of a leading standard XML line containing XML version and encoding. The ‘xmlns’ switch enables printing of qualified XMLNS prefixes.
Parameters: - XML_declaration (bool) – if
True
(default) prints a leading XML declaration line - xmlns (bool) – if
True
(default) prints full XMLNS prefixes
Returns: an XML-formatted string
- XML_declaration (bool) – if
pyowm.pollutionapi30.no2index module¶
Nitrogen Dioxide classes and data structures.
-
class
pyowm.pollutionapi30.no2index.
NO2Index
(reference_time, location, interval, no2_samples, reception_time)[source]¶ Bases:
object
A class representing the Nitrogen DiOxide Index observed in a certain location in the world. The index is made up of several measurements, each one at a different atmospheric levels. The location is represented by the encapsulated Location object.
Parameters: - reference_time (int) – GMT UNIXtime telling when the NO2 data has been measured
- location (Location) – the Location relative to this NO2 observation
- interval (str) – the time granularity of the NO2 observation
- no2_samples (list of dicts) – the NO2 samples
- reception_time (int) – GMT UNIXtime telling when the NO2 observation has been received from the OWM Weather API
Returns: a NO2Index instance
Raises: ValueError when negative values are provided as reception time, NO2 samples are not provided in a list
-
get_interval
()[source]¶ Returns the time granularity interval for this NO2 index measurement
Returns: str
-
get_location
()[source]¶ Returns the Location object for this NO2 index measurement
Returns: the Location object
-
get_reception_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the NO2 observation has been received from the OWM Weather API
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
get_reference_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the NO2 samples have been measured
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
get_sample_by_label
(label)[source]¶ Returns the NO2 sample having the specified label or None if none is found
Parameters: label – the label for the seeked NO2 sample Returns: dict or None
-
is_forecast
()[source]¶ Tells if the current NO2 observation refers to the future with respect to the current date :return: bool
-
to_XML
(xml_declaration=True, xmlns=True)[source]¶ Dumps object fields to an XML-formatted string. The ‘xml_declaration’ switch enables printing of a leading standard XML line containing XML version and encoding. The ‘xmlns’ switch enables printing of qualified XMLNS prefixes.
Parameters: - XML_declaration (bool) – if
True
(default) prints a leading XML declaration line - xmlns (bool) – if
True
(default) prints full XMLNS prefixes
Returns: an XML-formatted string
- XML_declaration (bool) – if
pyowm.pollutionapi30.so2index module¶
Sulphur Dioxide classes and data structures.
-
class
pyowm.pollutionapi30.so2index.
SO2Index
(reference_time, location, interval, so2_samples, reception_time)[source]¶ Bases:
object
A class representing the Sulphur Dioxide Index observed in a certain location in the world. The index is made up of several measurements, each one at a different atmospheric pressure. The location is represented by the encapsulated Location object.
Parameters: - reference_time (int) – GMT UNIXtime telling when the SO2 data has been measured
- location (Location) – the Location relative to this SO2 observation
- interval (str) – the time granularity of the SO2 observation
- so2_samples (list of dicts) – the SO2 samples
- reception_time (int) – GMT UNIXtime telling when the SO2 observation has been received from the OWM Weather API
Returns: an SOIndex instance
Raises: ValueError when negative values are provided as reception time, SO2 samples are not provided in a list
-
get_interval
()[source]¶ Returns the time granularity interval for this SO2 index measurement
Returns: str
-
get_location
()[source]¶ Returns the Location object for this SO2 index measurement
Returns: the Location object
-
get_reception_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the SO2 observation has been received from the OWM Weather API
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
get_reference_time
(timeformat='unix')[source]¶ Returns the GMT time telling when the SO2 samples have been measured
Parameters: timeformat (str) – the format for the time value. May be: ‘unix’ (default) for UNIX time ‘iso’ for ISO8601-formatted string in the format YYYY-MM-DD HH:MM:SS+00
‘date fordatetime.datetime
object instanceReturns: an int or a str Raises: ValueError when negative values are provided
-
is_forecast
()[source]¶ Tells if the current SO2 observation refers to the future with respect to the current date :return: bool
-
to_XML
(xml_declaration=True, xmlns=True)[source]¶ Dumps object fields to an XML-formatted string. The ‘xml_declaration’ switch enables printing of a leading standard XML line containing XML version and encoding. The ‘xmlns’ switch enables printing of qualified XMLNS prefixes.
Parameters: - XML_declaration (bool) – if
True
(default) prints a leading XML declaration line - xmlns (bool) – if
True
(default) prints full XMLNS prefixes
Returns: an XML-formatted string
- XML_declaration (bool) – if