PlaceController#

class pyinaturalist.controllers.PlaceController(client)#

Bases: BaseController

Controller for Place requests

Methods

__call__(place_id, **kwargs)#

Get a single place by ID

Example

>>> client.places(67591)
Parameters:

place_ids – A single place ID

Return type:

Optional[Place]

__init__(client)#
autocomplete(q=None, **params)#

Given a query string, get places with names starting with the search term

Notes

Example

>>> client.places.autocomplete('Irkutsk')
Parameters:

q (Optional[str]) – Search query

Return type:

Paginator[Place]

from_ids(place_ids, **params)#

Get places by ID

Notes

Example

>>> client.places.from_ids([67591, 89191])
Parameters:

place_ids (Union[int, Iterable[int], str, Iterable[str]]) – One or more place IDs

Return type:

Paginator[Place]

nearby(nelat, nelng, swlat, swlng, name=None, **params)#

Search for places near a given location

Notes

Example

>>> bounding_box = (150.0, -50.0, -149.999, -49.999)
>>> client.places.nearby(*bounding_box)
Parameters:
  • nelat (float) – NE latitude of bounding box

  • nelng (float) – NE longitude of bounding box

  • swlat (float) – SW latitude of bounding box

  • swlng (float) – SW longitude of bounding box

  • name (Optional[str]) – Name must match this value

Return type:

Paginator[Place]