Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roo-oliv/staticmaps-signature
Easily sign Google StaticMap API request urls with your API Key or Client ID.
https://github.com/roo-oliv/staticmaps-signature
api-key client-id google-api google-maps google-maps-api private-key secret signature staticmap staticmaps
Last synced: 2 months ago
JSON representation
Easily sign Google StaticMap API request urls with your API Key or Client ID.
- Host: GitHub
- URL: https://github.com/roo-oliv/staticmaps-signature
- Owner: roo-oliv
- License: mit
- Created: 2017-09-22T18:41:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T18:05:57.000Z (about 2 years ago)
- Last Synced: 2024-07-08T22:43:32.287Z (7 months ago)
- Topics: api-key, client-id, google-api, google-maps, google-maps-api, private-key, secret, signature, staticmap, staticmaps
- Language: Python
- Homepage: http://staticmaps-signature.readthedocs.io
- Size: 31.3 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
StaticMaps Signature
====================Easily sign Google StaticMap API request urls with your API Key or Client ID.
Python 2.x and 3.x are supported.
.. |build| image:: https://travis-ci.org/allrod5/staticmaps-signature.svg?branch=master
:target: https://travis-ci.org/allrod5/staticmaps-signature
:scale: 100%
:align: middle
.. |coverage| image:: https://coveralls.io/repos/github/allrod5/staticmaps-signature/badge.svg?branch=master
:target: https://coveralls.io/github/allrod5/staticmaps-signature?branch=master
:scale: 100%
:align: middle+---------+------------+
| |build| | |coverage| |
+---------+------------+Usage
-----Using StaticMaps Signature is pretty straight forward:
.. code:: python
from staticmaps_signature import StaticMapURLSigner
staticmap_url_signer = StaticMapURLSigner(
public_key=YOUR_API_KEY, private_key=YOUR_SECRET)signed = staticmap_url_signer.sign_url(URL_TO_SIGN)
This will return your URL appended with
``'&key=YOUR_API_KEY&signature=UNIQUE_SIGNATURE'``.If you wish to use your Cliend ID instead then just instantiate
:class:`StaticMapURLSigner` like this:.. code:: python
staticmap_url_signer = StaticMapURLSigner(
client_id=YOUR_CLIENT_ID, private_key=YOUR_SECRET)In case your URL already contains your API Key or Cliend ID instantiate
:class:`StaticMapURLSigner` with your shared secret only:.. code:: python
staticmap_url_signer = StaticMapURLSigner(private_key=YOUR_SECRET)
If you want just to append your API Key to the URL rather than signing it
just instantiate :class:`StaticMapURLSigner` with your key only:.. code:: python
staticmap_url_signer = StaticMapURLSigner(public_key=YOUR_API_KEY)
That's all there is for it.
This project is not maintained or supported by Google nor Google Maps.