Skip to main content

Python street view processing tools

Project description

pysvi Street View Image Processing Library

This library provides a Photo class to handle basic street view image processing tasks, including reading images, displaying them, and retrieving image file details.

Features

  • Read and display images
  • Get image dimensions (width and height)
  • Get image file size

Installation

  1. Ensure you have Python installed.

  2. Install the Pillow library if you haven't already:

    pip install pillow
    
  3. Download or clone this repository.

  4. Include the street_view directory in your project.

Usage

Here is a basic example of how to use the Photo class:

from StreetSolarTrack import Photo

# Create a Photo instance and read an image
photo = Photo('path_to_your_image.jpg')

# Display the object's string representation
print(photo)

# Show the image
photo.show_image()

# Get and print the image dimensions
print(f"Image size (width, height): {photo.get_image_size()}")

# Get and print the file size
print(f"File size (bytes): {photo.get_file_size()}")

API Documentation

API Documentation

Photo

__init__(self, file_path=None)

Initialize a Photo instance.

  • file_path (str, optional): The path to the image file. If provided, the image will be read during initialization.

read_image(self, file_path)

Read an image from a file path.

  • file_path (str): The path to the image file.

Raises:

  • FileNotFoundError: If the file does not exist.

show_image(self)

Display the image using the default image viewer.

get_image_size(self)

Get the size (width, height) of the image.

Returns:

  • Tuple (int, int): The width and height of the image.

Raises:

  • ValueError: If no image is loaded.

get_file_size(self)

Get the file size of the image in bytes.

Returns:

  • int: The file size in bytes.

Raises:

  • ValueError: If no file path is provided.

__repr__(self)

Return a string representation of the Photo instance.

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

StreetSolarTrack-0.0.4.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

StreetSolarTrack-0.0.4-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file StreetSolarTrack-0.0.4.tar.gz.

File metadata

  • Download URL: StreetSolarTrack-0.0.4.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for StreetSolarTrack-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d421b1d2f379230873647d640ec50d3aa848f3e8f37ae9ae23a3448a510f0c27
MD5 9e691da7927d4bf9aaf2dc55487f392c
BLAKE2b-256 a68bd4e7f4c4f01390b6706e8d85381241f87d9ea91ccdb6eef62e635ecc0f7a

See more details on using hashes here.

File details

Details for the file StreetSolarTrack-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for StreetSolarTrack-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7a828a23e4f5ab9903911779eb5d5395333aa52bc8a23dcd0538a192904cbf32
MD5 36de72ec30f6ba96a4c31902c810f81d
BLAKE2b-256 e98a13a8d4d4d3f33abdb047e448342d9462c4da2a1f93b6957209d5ee336245

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page