MCPcopy Index your code
hub / github.com/googlemaps/google-maps-services-python / _places

Function _places

googlemaps/places.py:377–425  ·  view source on GitHub ↗

Internal handler for ``places`` and ``places_nearby``. See each method's docs for arg details.

(
    client,
    url_part,
    query=None,
    location=None,
    radius=None,
    keyword=None,
    language=None,
    min_price=0,
    max_price=4,
    name=None,
    open_now=False,
    rank_by=None,
    type=None,
    region=None,
    page_token=None,
)

Source from the content-addressed store, hash-verified

375
376
377def _places(
378 client,
379 url_part,
380 query=None,
381 location=None,
382 radius=None,
383 keyword=None,
384 language=None,
385 min_price=0,
386 max_price=4,
387 name=None,
388 open_now=False,
389 rank_by=None,
390 type=None,
391 region=None,
392 page_token=None,
393):
394 """
395 Internal handler for ``places`` and ``places_nearby``.
396 See each method's docs for arg details.
397 """
398
399 params = {"minprice": min_price, "maxprice": max_price}
400
401 if query:
402 params["query"] = query
403 if location:
404 params["location"] = convert.latlng(location)
405 if radius:
406 params["radius"] = radius
407 if keyword:
408 params["keyword"] = keyword
409 if language:
410 params["language"] = language
411 if name:
412 params["name"] = convert.join_list(" ", name)
413 if open_now:
414 params["opennow"] = "true"
415 if rank_by:
416 params["rankby"] = rank_by
417 if type:
418 params["type"] = type
419 if region:
420 params["region"] = region
421 if page_token:
422 params["pagetoken"] = page_token
423
424 url = "/maps/api/place/%ssearch/json" % url_part
425 return client._request(url, params)
426
427
428def place(

Callers 2

placesFunction · 0.85
places_nearbyFunction · 0.85

Calls 1

_requestMethod · 0.80

Tested by

no test coverage detected