Easily sign Google StaticMap API request urls with your API Key or Client ID
Project description
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.
====================
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file staticmaps-signature-0.2.0.tar.gz
.
File metadata
- Download URL: staticmaps-signature-0.2.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95bfd46902c7a484e32a7192573ea97dbe6c1bece35d3c287f88982e77377c91 |
|
MD5 | 7610e7cd8232b4339547605570867948 |
|
BLAKE2b-256 | 8b4eb8b5b6f846dabe7d129c30cb65f5172c3b9f2ce7583363f1a0c3ce71470e |