Stop and search¶
-
class
police_api.stop_and_search.
Stop
(api, data={})[source]¶ A stop and search incident. Only a few of the attributes here are guaranteed to be provided by forces, so take care around any
None
values you may encounter.>>> from police_api import PoliceAPI >>> api = PoliceAPI() >>> def sort_stops_by_date(unsorted_stops): ... return(sorted(unsorted_stops, key=lambda s: s.datetime)) >>> stops = sort_stops_by_date( ... api.get_stops_force('metropolitan', '2015-07') ... )
-
age_range
¶ Type: str Human-readable string representing the age range of the person stopped.
>>> print(stops[0].age_range) 25-34
-
object_of_search
¶ Type: str The officer’s justification for conducting the search.
-
outcome
¶ Type: str The outcome of the stop.
>>> print(stops[0].outcome) Offender given drugs possession warning
-
outcome_linked_to_object_of_search
¶ Type: bool Whether the outcome of the stop was related to the reason the stop was conducted.
-
legislation
¶ Type: str The legislation allowing this particular stop.
>>> print(stops[0].legislation) Misuse of Drugs Act 1971 (section 23)
-
type
¶ Type: str What type of search this was (person, vehicle, etc.).
>>> print(stops[0].type) Person search
-
involved_person
¶ Type: bool Whether or not a person was searched in this stop.
>>> stops[0].involved_person True >>> vehicle_stop = [ ... s for s in stops if s.type == 'Vehicle search' ... ][0] >>> vehicle_stop.involved_person False
-
operation
¶ Type: bool Whether this stop was part of a policing operation.
-
operation_name
¶ Type: str The name of the policing operation this stop was part of, if applicable.
-
self_defined_ethnicity
¶ Type: str The ethnicity of the person stopped, as reported by the person stopped.
>>> print(stops[0].self_defined_ethnicity) Black or Black British - Any other Black ethnic background (B9)
-
officer_defined_ethnicity
¶ Type: str The ethnicity of the person stopped, as reported by the officer who conducted the stop.
>>> print(stops[0].officer_defined_ethnicity) Black
-
gender
¶ Type: str The gender of the person stopped. It is not clear if this is as reported by the officer or the person stopped.
>>> print(stops[0].gender) Male
-
datetime
¶ Type: datetime When the stop was conducted. Note that if a force appears to only conduct stops at midnight, that probably means they don’t record the time of stops.
>>> print(stops[0].datetime.isoformat()) 2015-07-01T00:05:00
-
location
¶ Type: Location
The approximate location of the stop.
-
removal_of_more_than_outer_clothing
¶ Type: bool Whether significant clothing was removed in order to carry out the search.
-