Skip to main content

street_view_image_downloader

The street_view_image_downloader package provides an easy way to download images from Google Street View, based on specified latitude and longitude. One of the highlighted features is the ability to switch between multiple API keys after a set number of images, useful for projects requiring a large number of downloads.

Installation

pip install street_view_image_downloader

Before you use this package, make sure you have the following libraries installed:

pip install requests
pip install pillow

Usage

1. Initialize the StreetViewDownloader:

from street_view_image_downloader import StreetViewDownloader
api_key = "YOUR_API_KEY"
downloader = StreetViewDownloader(api_key)

2. Download a Single Image:

lat, lng = 37.4219999,-122.0840575
downloader.download_image(lat, lng)

3. Download Multiple Images from a CSV:

The CSV file should have at least two columns labeled latitude and longitude.

downloader.batch_download('test_data.csv', output_folder='test_images')

4. Switching Between Multiple API Keys:

If you have multiple API keys and wish to switch between them after a certain number of images:

api_keys_list = ['YOUR_FIRST_API_KEY', 'YOUR_SECOND_API_KEY']
downloader.batch_download('test_data.csv', output_folder='test_images_with_keys', api_keys=api_keys_list, images_per_key=3)

5. Download Panoramic Images:

downloader.download_image(lat, lng, panorama=True)

6. Batch Download of Panoramas with API Key Switching:

downloader.batch_download('test_data.csv', output_folder='panorama_images_with_keys', api_keys=api_keys_list, images_per_key=3, panorama=True)

Function Parameters:

  • download_image():

    • lat, lng: Coordinates for the image location.
    • size: Image size (default is '640x480').
    • fov: Field of view (default is 90).
    • heading: Direction of the camera (default is 0).
    • pitch: Vertical angle of the camera (default is 0).
    • radius: Defines search radius in meters (default is 50).
    • source: Source of image (default is 'default').
    • params: Additional parameters to add to the URL (default is None).
    • output_folder: Folder to save the image (default is the current directory).
    • panorama: Download and stitch images from four different headings to create a panoramic image (default is False).
  • batch_download():

    • csv_file: Path to the CSV file with latitude and longitude columns.
    • output_folder: Folder to save the images.
    • api_keys: List of API keys to switch between.
    • images_per_key: Number of images to download before switching to the next API key.
    • panorama: Download panoramic images (default is False).
    • Other parameters are the same as download_image.

Important Note:

Ensure that your API keys have the necessary permissions and quota to access and download from Google Street View. The API key switching feature is particularly useful to distribute the load across multiple keys and stay within the quota limits.

Happy downloading!

Metadata

Release files for street-view-image-downloader 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for street-view-image-downloader 0.1
File Size Uploaded
street_view_image_downloader-0.1.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for street-view-image-downloader 0.1
File Interpreter ABI Platform
street_view_image_downloader-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / street_view_image_downloader-0.1.tar.gz

Download URL street_view_image_downloader-0.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8d219c588d9ac00256a6c9787cbc2acd1bba49b17c58be5b1b9b0b8b1d75cabc
BLAKE2b-256 checksum
How to use checksums
b000aba86257f99f5f0034a394fb8ad90b6de8d77c75e303c7d1e3a2c9292bc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / street_view_image_downloader-0.1-py3-none-any.whl

Download URL street_view_image_downloader-0.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fda5fe75f0f304ffaf3454f8835a81c5f1fd1aab416d8376e47779089621439d
BLAKE2b-256 checksum
How to use checksums
76c5ec8269a07e0a70749171ecaaaa02dedab2ee26bd7f63f00129f1b0a6059c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page