Skip to main content

streetview-tools

Retrieve panorama metadata and download panorama images from Google Street View, Naver Roadview, and Kakao Roadview.

Installation

pip install streetview-tools

Usage

from streetview_tools import google

pano = google.get_pano_info(panoid="PANORAMA_ID")
google.save_img(
	panoid="PANORAMA_ID",
	file_name="output.png",
	width=2048,
)

The same functions are available from streetview_tools.naver and streetview_tools.kakao.

Google and Kakao also provide save_img_face() for saving a square direction crop from their equirectangular panorama images. The supported directions are l, f, r, b, d, and u, and the default filename is PANORAMA_ID_<direction>.png.

For Naver cubic panoramas, a single direction can be saved as a square image:

from streetview_tools import naver

naver.save_img_face(
	panoid="PANORAMA_ID",
	direction="u",
	width=800,
)
# PANORAMA_ID_u.png

Valid directions are l, f, r, b, d, and u. A direction can also be provided as a list, which returns or saves one image per direction:

images = naver.get_img_face(
	panoid="PANORAMA_ID",
	direction=["l", "f", "r"],
	width=800,
)
paths = naver.save_img_face(
	panoid="PANORAMA_ID",
	direction=["l", "f", "r"],
	width=800,
)

Each function returns a list for face requests. get_img() returns one PIL image, while save_img() returns one output path.

The same save_img_face() function can convert Naver equirectangular images by passing proj_type="equirect". Google and Kakao use the same common equirectangular-to-cubemap conversion internally.

width and height are optional. If either is provided, the output is always 2:1. When both are provided, width takes precedence. For example, width=1024, height=900 produces a 1024 x 512 image, while height=512 produces a 1024 x 512 image. An odd width is rounded down to the nearest even width so the final image can remain exactly 2:1.

When width is provided, the smallest available zoom that is at least as wide as the requested output is downloaded first, then resized to the final size. Without width, each service's default zoom is used. zoom is an internal implementation detail and is not part of the public function arguments.

This package accesses public web endpoints used by each map service. Endpoint formats and availability may change independently of this package.

Pass save_json=True to save_img() or save_img_face() to save the get_pano_info() result beside the image. For example, pano.png produces pano.json.

For save_img_face(), the JSON angle is adjusted for the selected direction: f keeps the original angle, r adds 90 degrees, l subtracts 90 degrees, and b adds 180 degrees. Angles are normalized to 0-360 degrees; u and d keep the original horizontal angle.

Release files for streetview-tools 0.1.0

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

Source distribution (sdist)

Source distribution for streetview-tools 0.1.0
File Size Uploaded
streetview_tools-0.1.0.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streetview-tools 0.1.0
File Interpreter ABI Platform
streetview_tools-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.5 kB

Release files / streetview_tools-0.1.0.tar.gz

Download URL streetview_tools-0.1.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
64740eede33bc04ac8d8728bfd821e92e23961b84e3c0f9a90802610d7f537d3
BLAKE2b-256 checksum
How to use checksums
6828a3cc72be9ddbbb2827e04dd60f19896cc0e06125c4f338c9861be55c6bd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / streetview_tools-0.1.0-py3-none-any.whl

Download URL streetview_tools-0.1.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5f0a9c09335bb58f00d9743f59f812a4622fc3d787df4048fe7a8d5cdc1ed09
BLAKE2b-256 checksum
How to use checksums
3e3a551429a985537123755823d16e3c18665aa410ed9affe38e7768f1ad568f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 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