Skip to main content

Mapfy

Mapfy queries public Google Maps results, normalizes each candidate as a PlaceResult, builds a direct Google Maps link, and returns a single Street View image URL when one is available.

What it returns

Each result can include place_id, name, category, address, website, rating, reviews_count, latitude, longitude, maps_url, and image_url. maps_url opens the location in Google Maps; image_url points to its Street View image and does not expose the panorama ID separately.

Mapfy uses an internal Maps endpoint that Google does not document. Changes to the response format may require a parser update.

Public API

The client exposes two searches:

  • search(): resolves an address, coordinates, or free-text location query.
  • search_places(): finds establishments by name, category, or type.

Installation

uv add mapfy

Usage

from mapfy import Mapfy

with Mapfy() as client:
    places = client.search_places(
        query="coffee shop",
        near="Seattle, WA",
        limit=10,
    )

for place in places:
    print(place.name, place.maps_url, place.image_url)

near is optional and accepts an address, a coordinate string ("47.61,-122.33"), or a coordinate tuple ((47.61, -122.33)). language and country are optional; when omitted, Google determines the request context.

limit=None returns every result received. A positive integer returns up to that many results while preserving the order returned by Maps.

search() preserves every candidate returned by Maps, so ambiguous addresses do not get reduced to an arbitrary first result.

addresses = client.search("47.61, -122.33")

Structure

src/mapfy/
├── client.py
├── models.py
├── parser.py
├── common.py
└── __init__.py

Development

uv sync --no-dev --group lint --group test
uv run ruff format
uv run ruff check
uv run ty check

Metadata

Release files for mapfy 0.1.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 mapfy 0.1.1
File Size Uploaded
mapfy-0.1.1.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mapfy 0.1.1
File Interpreter ABI Platform
mapfy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 kB

Release files / mapfy-0.1.1.tar.gz

Download URL mapfy-0.1.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c4da881bf72e851836b9e44213a286282c46efba053e18df28c360c6573fe32d
BLAKE2b-256 checksum
How to use checksums
be7ca7efdf7cf8e2dec614d8618da29712fb9f405444914b4386c184f921662c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mapfy-0.1.1-py3-none-any.whl

Download URL mapfy-0.1.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48826bb697ef0a2a37177cb320cdbf71809dec62ec69eb941fbbcdb754a4a2ad
BLAKE2b-256 checksum
How to use checksums
96438954ed23aafe273b55eab0ef54df50ee0d492b0f70135d372eb55b67b25a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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