# ug
Utils using Google API
To install: ```pip install ug```
You'll also need to get a [Google API key](https://support.google.com/googleapi/answer/6158862?hl=en)
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
```python
>>> 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}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/thorwhalen/ug",
"name": "ug",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Thor Whalen",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/47/ce/e645bcf1b59344e2270aeea46e42d0b75a62b260a82cb6121bc26dd92582/ug-0.0.10.tar.gz",
"platform": "any",
"description": "# ug\n\nUtils using Google API\n\nTo install:\t```pip install ug```\n\nYou'll also need to get a [Google API key](https://support.google.com/googleapi/answer/6158862?hl=en)\nand enable the maps services for it. \n\nWhen you call a function, in the `gmaps_client`, you can specify the key itself \nor can specify the environment variable (prefixed with `\"$\"`) where you stored it, \nor even a fully instantiated client you made yourself. \nIf you don't specify anything, it will use `\"$GOOGLE_API_KEY\"` as the default \n(so will look for an API key in the `GOOGLE_API_KEY` environment variable).\n\n\n# Examples\n\n## Google maps\n\n```python\n>>> r = search_maps(\"meditation\", \"Aix-en-Provence\", radius_in_meters=3000)\n>>> len(r)\n10\n>>> [x['formatted_address'] for x in r] # doctest: +SKIP\n['90A Rue Jean Dausset, 13090 Aix-en-Provence, France',\n'24 Rue Thiers, 13100 Aix-en-Provence, France',\n...\n'700 Chem. de Banon, 13100 Aix-en-Provence, France',\n'31 Cr Gambetta 13100, 13090 Aix-en-Provence, France']\n>>> r[0] # doctest: +SKIP\n'business_status': 'OPERATIONAL',\n'formatted_address': '90A Rue Jean Dausset, 13090 Aix-en-Provence, France',\n'geometry': {'location': {'lat': 43.53714249999999, 'lng': 5.4149873},\n'viewport': {'northeast': {'lat': 43.53849157989272,\n 'lng': 5.416325329892722},\n'southwest': {'lat': 43.53579192010728, 'lng': 5.413625670107278}}},\n'icon': 'https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/school-71.png',\n'icon_background_color': '#7B9EB0',\n'icon_mask_base_uri': 'https://maps.gstatic.com/mapfiles/place_api/icons/v2/school_pinlet',\n'name': 'Pleine conscience aix',\n'opening_hours': {'open_now': True},\n'photos': [{'height': 1067,\n'html_attributions': ['<a href=\"https://maps.google.com/maps/contrib/114127511381087003840\">A Google User</a>'],\n'photo_reference': 'AdCG2DNSD6nzorLbQagoMyC_ATRfKWAtXYzDknmBYspoXGnJzeqxScNA3VIhF4wPKkAuI3W4KBOEvibZenNuO0qRVbNYkBFUahJSRPXJjtHFQj4nBur4auszmIwykM8QoMxcrHucGcwcYbj3GZnat1r6nDJXWAKrWLDEqbf9P4mVDoFIr7Vg',\n'width': 1600}],\n'place_id': 'ChIJbc-zeTeNyRIRrtgswndfJ34',\n'plus_code': {'compound_code': 'GCP7+VX Aix-en-Provence',\n'global_code': '8FM7GCP7+VX'},\n'rating': 5,\n'reference': 'ChIJbc-zeTeNyRIRrtgswndfJ34',\n'types': ['school', 'health', 'point_of_interest', 'establishment'],\n'user_ratings_total': 3}\n```\n",
"bugtrack_url": null,
"license": "mit",
"summary": "Utils using Google API",
"version": "0.0.10",
"project_urls": {
"Homepage": "https://github.com/thorwhalen/ug"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a3b432d392adf7c298bb2371a276d163db47e4fdc9fb57c24e126154191d68f0",
"md5": "6efd1ea597429400914f454a28eff315",
"sha256": "46e4b3459d67636d76dd10ff94face3ed5d833935f4dedd2251b021cf02989bd"
},
"downloads": -1,
"filename": "ug-0.0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6efd1ea597429400914f454a28eff315",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 8327,
"upload_time": "2024-10-10T12:10:19",
"upload_time_iso_8601": "2024-10-10T12:10:19.541848Z",
"url": "https://files.pythonhosted.org/packages/a3/b4/32d392adf7c298bb2371a276d163db47e4fdc9fb57c24e126154191d68f0/ug-0.0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "47cee645bcf1b59344e2270aeea46e42d0b75a62b260a82cb6121bc26dd92582",
"md5": "2a0799e87ff22c50344108d765471bba",
"sha256": "9446e78815b51ce062f32c018ca9569bddda319fc6944622c5e7eb4017398da8"
},
"downloads": -1,
"filename": "ug-0.0.10.tar.gz",
"has_sig": false,
"md5_digest": "2a0799e87ff22c50344108d765471bba",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7237,
"upload_time": "2024-10-10T12:10:21",
"upload_time_iso_8601": "2024-10-10T12:10:21.001139Z",
"url": "https://files.pythonhosted.org/packages/47/ce/e645bcf1b59344e2270aeea46e42d0b75a62b260a82cb6121bc26dd92582/ug-0.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-10 12:10:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thorwhalen",
"github_project": "ug",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ug"
}