Utils using Google API
Project description
ug
Utils using Google API
To install: pip install ug
You'll also need to get a Google API key and enable the maps services for it.
When you call a function, in the gmaps_client
, you can specify the key itself
or can specify the environment variable (prefixed with "$"
) where you stored it,
or even a fully instantiated client you made yourself.
If you don't specify anything, it will use "$GOOGLE_API_KEY"
as the default
(so will look for an API key in the GOOGLE_API_KEY
environment variable).
Examples
Google maps
>>> r = search_maps("meditation", "Aix-en-Provence", radius_in_meters=3000)
>>> len(r)
10
>>> [x['formatted_address'] for x in r] # doctest: +SKIP
['90A Rue Jean Dausset, 13090 Aix-en-Provence, France',
'24 Rue Thiers, 13100 Aix-en-Provence, France',
...
'700 Chem. de Banon, 13100 Aix-en-Provence, France',
'31 Cr Gambetta 13100, 13090 Aix-en-Provence, France']
>>> r[0] # doctest: +SKIP
'business_status': 'OPERATIONAL',
'formatted_address': '90A Rue Jean Dausset, 13090 Aix-en-Provence, France',
'geometry': {'location': {'lat': 43.53714249999999, 'lng': 5.4149873},
'viewport': {'northeast': {'lat': 43.53849157989272,
'lng': 5.416325329892722},
'southwest': {'lat': 43.53579192010728, 'lng': 5.413625670107278}}},
'icon': 'https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/school-71.png',
'icon_background_color': '#7B9EB0',
'icon_mask_base_uri': 'https://maps.gstatic.com/mapfiles/place_api/icons/v2/school_pinlet',
'name': 'Pleine conscience aix',
'opening_hours': {'open_now': True},
'photos': [{'height': 1067,
'html_attributions': ['<a href="https://maps.google.com/maps/contrib/114127511381087003840">A Google User</a>'],
'photo_reference': 'AdCG2DNSD6nzorLbQagoMyC_ATRfKWAtXYzDknmBYspoXGnJzeqxScNA3VIhF4wPKkAuI3W4KBOEvibZenNuO0qRVbNYkBFUahJSRPXJjtHFQj4nBur4auszmIwykM8QoMxcrHucGcwcYbj3GZnat1r6nDJXWAKrWLDEqbf9P4mVDoFIr7Vg',
'width': 1600}],
'place_id': 'ChIJbc-zeTeNyRIRrtgswndfJ34',
'plus_code': {'compound_code': 'GCP7+VX Aix-en-Provence',
'global_code': '8FM7GCP7+VX'},
'rating': 5,
'reference': 'ChIJbc-zeTeNyRIRrtgswndfJ34',
'types': ['school', 'health', 'point_of_interest', 'establishment'],
'user_ratings_total': 3}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ug-0.0.11.tar.gz
(8.0 kB
view details)
Built Distribution
ug-0.0.11-py3-none-any.whl
(8.7 kB
view details)
File details
Details for the file ug-0.0.11.tar.gz
.
File metadata
- Download URL: ug-0.0.11.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a99458cff5d78ddbb4b12fb0901d091e26d199b9372c1675112fd50e6ab5817 |
|
MD5 | f78dc7990ccca384beaff5edb9616087 |
|
BLAKE2b-256 | b6882d4b6556536498e600ecc35b02f2970456dd7100dd0837a222de4f65b36e |
File details
Details for the file ug-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: ug-0.0.11-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8afbc3a8d48ec34996d835570caf627a4a2794b3389e6e16bb3c7016dabdd810 |
|
MD5 | c1d05098e7efdcb8461698cc74dfe138 |
|
BLAKE2b-256 | 8f337800c611c9aa1cadce97b3c3a12683389076e3c8cd72b2657c52845f2a14 |