Forces¶
-
class
police_api.forces.Force(api, preload=False, **attrs)¶ A police force in England, Wales or Northern Ireland. Uses the force API call.
>>> from police_api import PoliceAPI >>> from police_api.forces import Force >>> api = PoliceAPI() >>> force = Force(api, id='leicestershire') >>> force.name 'Leicestershire'
Parameters: - api (PoliceAPI) – The instance of
PoliceAPIto use. - preload (bool) – If
True, attributes are loaded from the API on instantiation rather than waiting for a property to be accessed. - attrs – Only the
idis required. Any other attributes supplied will be set on the instance and not fetched from the API.
-
id¶ Type: str The force’s identifier (a slugified version of the name).
-
name¶ Type: str The full name of the force.
-
description¶ Type: str A short description of the force’s role.
-
url¶ Type: str The force’s website address.
-
telephone¶ Type: str The force’s main switchboard number. Usually set to
'101'since the introduction of the national service.
-
engagement_methods¶ Type: list A
listofdict, containing the keysurl,type,description, andtitle.>>> pprint(force.engagement_methods) [{u'description': None, u'title': u'facebook', u'type': u'facebook', u'url': u'http://www.facebook.com/leicspolice'}, {u'description': None, u'title': u'twitter', u'type': u'twitter', u'url': u'http://www.twitter.com/leicspolice'}, {u'description': None, u'title': u'youtube', u'type': u'youtube', u'url': u'http://www.youtube.com/leicspolice'}, {u'description': None, u'title': u'rss', u'type': u'rss', u'url': u'http://www.leics.police.uk/feeds/news/'}, {u'description': None, u'title': u'telephone', u'type': u'telephone', u'url': u''}, {u'description': None, u'title': u'flickr', u'type': u'flickr', u'url': u'http://www.flickr.com/photos/leicspolice-property'}]
-
neighbourhoods¶ Type: list A
listofNeighbourhoodobjects (all the Neighbourhood Policing Teams in this force area).
-
senior_officers¶ Type: list A
listofForce.SeniorOfficerobjects.
- api (PoliceAPI) – The instance of