A command line tool and module for Google Street View Image API.
Project description
Install
Install Python
Install google_streetview via pip
pip install google_streetview
For the latest developer version, see Developer Install.
Usage
For help in the console:
google_streetview -h
Ensure that a Google API developer key is set:
google_streetview -s key="your_dev_key"
Search street view for latitude and longitude 46.414382,10.013988:
google_streetview "46.414382,10.013988"
Save images to a directory:
google_streetview --location="46.414382,10.013988" --save_downloads=downloads
Obtain a 360 panorama by rotating the camera heading given a 90 degree field of vision fov:
google_streetview --location="46.414382,10.013988" --fov=90 --heading=0;90;180;270
Use as a Python module:
# Import google_streetview for the api module
import google_streetview.api
# Define parameters for street view api
params = [{
'size': '600x300', # max 640x640 pixels
'location': '46.414382,10.013988',
'heading': '151.78',
'pitch': '-0.76',
'key': 'your_dev_key'
}]
# Create a results object
results = google_streetview.api.results(params)
# Download images to directory 'downloads'
results.download_links('downloads')
For more usage details, see the Documentation.
Developer Notes
Developer Install
Install the latest developer version with pip from github:
pip install git+https://github.com/rrwen/google_streetview
Install from git cloned source:
Ensure git is installed
Clone into current path
Install via pip
git clone https://github.com/rrwen/google_streetview cd google_streetview pip install . -I
Tests
Clone into current path git clone https://github.com/rrwen/google_streetview
Enter into folder cd google_streetview
Ensure unittest is available
Set your Google API developer key
Run tests
Reset config file to defaults
Please note that this will use up 16 requests from your quota
pip install . -I python -m google_streetview -s key=your_dev_key python -m unittest python -m google_streetview -d
Documentation Maintenance
Ensure sphinx is installed pip install -U sphinx
Update the documentation in docs/
pip install . -I sphinx-build -b html docs/source docs
Upload to github
Ensure git is installed
Add all files and commit changes
Push to github
git add . git commit -a -m "Generic update" git push
Upload to PyPi
Ensure twine is installed pip install twine
Ensure sphinx is installed pip install -U sphinx
Run tests and check for OK status
Delete dist directory
Update the version google_streetview/__init__.py
Update the documentation in docs/
Create source distribution
Upload to PyPi
pip install . -I python -m google_streetview -s key=your_dev_key python -m unittest python -m google_streetview -d sphinx-build -b html docs/source docs python setup.py sdist twine upload dist/*
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.