pyowm.commons package¶
Submodules¶
pyowm.commons.databoxes module¶
pyowm.commons.enums module¶
-
class
pyowm.commons.enums.
ImageTypeEnum
[source]¶ Bases:
object
Allowed image types on OWM APIs
-
GEOTIFF
= <pyowm.commons.databoxes.ImageType - name=GEOTIFF mime=image/tiff>¶
-
PNG
= <pyowm.commons.databoxes.ImageType - name=PNG mime=image/png>¶
-
pyowm.commons.frontlinkedlist module¶
Module containing class related to the implementation of linked-list data structure
-
class
pyowm.commons.frontlinkedlist.
FrontLinkedList
[source]¶ Bases:
pyowm.abstractions.linkedlist.LinkedList
Implementation of a linked-list data structure. Insertions are performed at the front of the list and so are O(1) while deletions take O(n) because they can be performed against any of the linked list’s elements. Each element in the list is a LinkedListNode instance; after instantiation, the list contains no elements.
Parameters: - first_node (LinkedListNode) – reference to the first LinkedListNode element in the list
- last_node (LinkedListNode) – reference to the last LinkedListNode element in the list
-
add
(data)[source]¶ Adds a new data node to the front list. The provided data will be encapsulated into a new instance of LinkedListNode class and linked list pointers will be updated, as well as list’s size.
Parameters: data (object) – the data to be inserted in the new list node
-
contains
(data)[source]¶ Checks if the provided data is stored in at least one node of the list.
Parameters: data (object) – the seeked data Returns: a boolean
-
index_of
(data)[source]¶ Finds the position of a node in the list. The index of the first occurrence of the data is returned (indexes start at 0)
Parameters: data – data of the seeked node Type: object Returns: the int index or -1 if the node is not in the list
-
class
pyowm.commons.frontlinkedlist.
FrontLinkedListIterator
(obj)[source]¶ Bases:
object
Iterator over the LinkedListNode elements of a LinkedList class instance. The implementation keeps a copy of the iterated list so avoid concurrency problems when iterating over it. This can nevertheless be memory-consuming when big lists have to be iterated over.
Parameters: obj (object) – the iterable object (LinkedList) Returns: a FrontLinkedListIterator instance
-
class
pyowm.commons.frontlinkedlist.
LinkedListNode
(data, next_node)[source]¶ Bases:
object
Class representing an element of the LinkedList
Parameters: - data (object) – the actual data that this node holds
- next (LinkedListNode) – reference to the next LinkedListNode instance in the list
-
update_next
(linked_list_node)[source]¶ Parameters: linked_list_node (LinkedListNode) – the new reference to the next LinkedListNode element
pyowm.commons.http_client module¶
pyowm.commons.image module¶
-
class
pyowm.commons.image.
Image
(data, image_type=None)[source]¶ Bases:
object
Wrapper class for a generic image
Parameters: - data (bytes) – raw image data
- image_type (pyowm.commons.databoxes.ImageType or None) – the type of the image, if known