Skip to main content

yatmo

Add real estate maps, points of interest and neighbourhood data to Python applications. yatmo is the official Python client for the Yatmo API: the written neighbourhood text of a property (rendered as HTML on the server, so search engines index it), the nearest schools, nurseries, supermarkets and public transport with real travel times, scores, listing enrichment, isochrones, routes, geocoding and static map images, in 25 countries and 23 languages. Works with Django, Flask, FastAPI, notebooks and scripts, Python 3.9 and later, no dependency.

pip install yatmo
from yatmo import Client, TravelMode, render_html

yatmo = Client(key="your_backend_key", country="BE", language="FR")

# The neighbourhood text as HTML, to write into the property page.
text = yatmo.summary_text(50.8461, 4.3664)
print(render_html(text))
# <div class="yatmo-text"><h3>Commerces près de la Rue de la Loi</h3><p>Un <strong>Carrefour</strong> à 3 minutes...

# The nearest places by category with walking times.
summary = yatmo.summary(50.8461, 4.3664)
for sub in summary.sub_categories():
    place = sub.places[0] if sub.places else None
    walk = place.travel(TravelMode.WALKING) if place else None
    print(sub.label, ":", place.name if place else "-", walk.travel_time_short_label if walk else "")

The Yatmo neighbourhood text on a property page

Install in 5 minutes

  1. Get a Yatmo licence key at yatmo.com and use the backend key on the server (keys explained).
  2. pip install yatmo.
  3. Create one Client per country, call summary_text() and summary() for each property, cache the answers (a neighbourhood rarely changes; summary_text_raw() and summary_raw() return plain dicts for that) and write the HTML into the page.

Runnable example: examples/property_page.py. The interactive map itself is an iframe with your frontend key, no Python needed: iframe plugin.

Client

yatmo = Client(
    key="your_backend_key",
    country="BE",                 # the API host is https://be.yatmo.com/
    language="FR",                # labels and texts, default EN
    transport=None,               # optional: any object with get(url, headers, timeout_seconds) -> (status, body)
    timeout_seconds=15,
)
Method Endpoint Returns
summary(lat, lng) /summary Summary: places by category with distances and travel times (walking, bicycling, driving, transit), closest cities, reverse-geocoded place
summary_text(lat, lng, language=None) /Summary/text SummaryText in one language, paragraphs with [STRONG] markers; see the renderers
summary_text_raw(lat, lng), summary_raw(lat, lng), scores_raw(lat, lng) The API answers as plain dicts, to cache; rebuild with SummaryText.from_wire(raw, language), Summary.from_wire(raw), Scores.from_wire(raw)
scores(lat, lng) /scores Scores: one 0 to 10 score per category
enrichment(lat, lng) /enrichment Ready-made listing attributes (nearest place per category, four travel modes), as a dict
points(south, west, north, east, poi_type_ids=()) /points Poi list inside a bounding box
simplified_categories() /SimplifiedCategories CategoryGroup list (name, POI type ids)
isochrones(lat, lng, mode) /Isochrone/GetMultipleTimes 5, 10 and 20 minute areas, GeoJSON geometries
isochrone(lat, lng, mode, seconds) /isochrone One area, GeoJSON geometry
route(from_lat, from_lng, to_lat, to_lng, mode) /route Route with paths (distance, duration, LineString)
geocode(address) /geolocation Place list, best match first
geocode_near(lat, lng, query) /Geolocation/GetClose Address autocomplete around a point
static_map(lat, lng, **options) /image JPEG bytes; static_map_url() gives the URL (color, width, height, map_style, three_d, big_icons, multi_borders, custom_marker)

Errors are typed: BadRequestError (400, position outside the country), AuthenticationError (401), ForbiddenError (403, country or endpoint not in the licence), QuotaError (429), TransportError (unreachable), all subclasses of YatmoError with a status.

Rendering the text

render_html(text, heading="h3", titles="street-city", paragraphs=None, strong=True, css_class="")
render_markdown(text, titles="street-city", paragraphs=None, strong=True)
render_plain(text, titles="street-city", paragraphs=None)

titles: the first heading names the street and the second the city ("street-city"), the city only ("city", for discreet listings) or neither ("generic"). paragraphs keeps some icon ids only among education, shopping, publictransports, transports, tourism, cities.

Django, Flask, FastAPI

# Django view
from django.core.cache import cache

def listing(request, pk):
    listing = Listing.objects.get(pk=pk)
    key = f"yatmo-text-{listing.latitude:.6f}-{listing.longitude:.6f}"
    raw = cache.get(key)
    if raw is None:
        raw = yatmo.summary_text_raw(listing.latitude, listing.longitude)
        cache.set(key, raw, 30 * 86400)
    neighbourhood = render_html(SummaryText.from_wire(raw, request.LANGUAGE_CODE))
    return render(request, "listing.html", {"listing": listing, "neighbourhood": neighbourhood})

In the template: {{ neighbourhood|safe }} below the map iframe.

Tests

python -m unittest discover tests                       # hermetic, the API is faked
YATMO_LIVE_KEY=your_backend_key python -m unittest tests.test_live   # one real call per endpoint

MIT licence. Yatmo is a paid service for real estate portals, agency networks and developers; a licence key is required.

Metadata

Release files for yatmo 1.0.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 yatmo 1.0.0
File Size Uploaded
yatmo-1.0.0.tar.gz 20.1 kB Details

Built distribution (wheel)

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

Total release size: 35.7 kB

Release files / yatmo-1.0.0.tar.gz

Download URL yatmo-1.0.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d5e65335009324eb4c8c3eb6dde5e4fb93a51b53978ad4baf6e79353bc543736
BLAKE2b-256 checksum
How to use checksums
3884adfabc9e8994eb31f5812342026a90ceaca5ad39b5832fd5db08e06995b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / yatmo-1.0.0-py3-none-any.whl

Download URL yatmo-1.0.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f0fb72a018b2b9807973b9345618ce1a18257bc8dbda49ae386d1b5b03b5a25
BLAKE2b-256 checksum
How to use checksums
c0d387a85d60224b76c0b9d6ea709aed1ede9738f5ac5cc9fef31d1c6b2f2e3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.0.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