Welcome to Week 5’s documentation!¶
Indices and tables¶
Auto Module¶
The program is made to demonstrate api calls using requests.
-
class
API.
BakerStreet
(**kwargs)¶ Bases:
API.Street
-
__init__
(**kwargs)¶ The constructor.
Parameters: - name (str) – The name of the street
- coor (str) – can take a coordinate
-
__str__
()¶ Warning
this only returns a string for the print function, it does not print the object.
Returns str: The string to be printed when printing the class.
-
get_incedents_year
()¶ - The incident gatherer.It increments incidents for every month of the year.
Parameters: self – to use local variables
-
-
class
API.
PrivetDrive
(**kwargs)¶ Bases:
API.Street
-
__init__
(**kwargs)¶ The constructor.
Parameters: - name (str) – The name of the street
- coor (str) – can take a coordinate
-
__str__
()¶ Warning
this only returns a string for the print function, it does not print the object.
Returns str: The string to be printed when printing the class.
-
get_incedents_year
()¶ - The incident gatherer.It increments incidents for every month of the year.
Parameters: self – to use local variables
-
-
class
API.
Street
¶ Bases:
object
Class that holds the methods and the variables for the street that is beeing searched.
Variables: - incidents (int) – the incident counter.
- url (str) – holds the API url
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
__str__
()¶ Warning
this only returns a string for the print function, it does not print the object.
Returns str: The string to be printed when printing the class.
-
get_incedents_year
()¶ - The incident gatherer.It increments incidents for every month of the year.
Parameters: self – to use local variables
-
incidents
= 0¶ incidents is set to 0
-
API.
get_all_Incedents
()¶ Gets the incodents for all streets
Returns tuple streets: Street objects with all incidents counted.
Auto Class¶
-
class
API.
BakerStreet
(**kwargs) Bases:
API.Street
-
__init__
(**kwargs) The constructor.
Parameters: - name (str) – The name of the street
- coor (str) – can take a coordinate
-
__str__
() Warning
this only returns a string for the print function, it does not print the object.
Returns str: The string to be printed when printing the class.
-
get_incedents_year
() - The incident gatherer.It increments incidents for every month of the year.
Parameters: self – to use local variables
-