How to use the googlemaps.convert.as_list function in googlemaps

To help you get started, we’ve selected a few googlemaps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlemaps / google-maps-services-python / test / test_convert.py View on Github external
def test_as_list(self):
        self.assertEqual([1], convert.as_list(1))

        self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))

        self.assertEqual(["string"], convert.as_list("string"))

        self.assertEqual((1, 2), convert.as_list((1, 2)))

        a_dict = {"a": 1}
        self.assertEqual([a_dict], convert.as_list(a_dict))
github googlemaps / google-maps-services-python / test / test_convert.py View on Github external
def test_as_list(self):
        self.assertEqual([1], convert.as_list(1))

        self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))

        self.assertEqual(["string"], convert.as_list("string"))

        self.assertEqual((1, 2), convert.as_list((1, 2)))

        a_dict = {"a": 1}
        self.assertEqual([a_dict], convert.as_list(a_dict))
github googlemaps / google-maps-services-python / test / test_convert.py View on Github external
def test_as_list(self):
        self.assertEqual([1], convert.as_list(1))

        self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))

        self.assertEqual(["string"], convert.as_list("string"))

        self.assertEqual((1, 2), convert.as_list((1, 2)))

        a_dict = {"a": 1}
        self.assertEqual([a_dict], convert.as_list(a_dict))
github googlemaps / google-maps-services-python / test / test_convert.py View on Github external
def test_as_list(self):
        self.assertEqual([1], convert.as_list(1))

        self.assertEqual([1, 2, 3], convert.as_list([1, 2, 3]))

        self.assertEqual(["string"], convert.as_list("string"))

        self.assertEqual((1, 2), convert.as_list((1, 2)))

        a_dict = {"a": 1}
        self.assertEqual([a_dict], convert.as_list(a_dict))
github googlemaps / google-maps-services-python / googlemaps / roads.py View on Github external
def speed_limits(client, place_ids):
    """Returns the posted speed limit (in km/h) for given road segments.

    :param place_ids: The Place ID of the road segment. Place IDs are returned
        by the snap_to_roads function. You can pass up to 100 Place IDs.
    :type place_ids: str or list

    :rtype: list of speed limits.
    """

    params = [("placeId", place_id) for place_id in convert.as_list(place_ids)]

    return client._request("/v1/speedLimits", params,
                       base_url=_ROADS_BASE_URL,
                       accepts_clientid=False,
                       extract_body=_roads_extract).get("speedLimits", [])