Skip to content

Restructure samples by use case - #3

Open
gaelsimon wants to merge 6 commits into
masterfrom
samples-by-use-case
Open

gaelsimon wants to merge 6 commits into
masterfrom
samples-by-use-case

Conversation

@gaelsimon

Copy link
Copy Markdown
Member

Adds the MIT licence and replaces the language-first layout with one folder per use case: stores import, sync and export, opening hours, batch geocoding, async distance matrix, isochrone search, datasets, static map and IP geolocation.

Python for every use case, Node for import, sync and the matrix, the Java client kept. Keys come from the environment, every script ships offline tests, and CI runs them plus a live smoke job when the repository secret is set.

The legacy Python 2 scripts, the Google import scripts and the jsFiddle demos on the retired Store Locator JS API are removed.

@gaelsimon
gaelsimon force-pushed the samples-by-use-case branch 4 times, most recently from fc194c4 to 0e0cea5 Compare September 14, 2026 07:11
Replace the language-first layout and its Python 2 era scripts with one folder per
use case: import, sync and export of stores, opening hours conversion, batch
geocoding, async distance matrix, isochrone search, datasets, static map and IP
geolocation. Python everywhere, Node for the three most used, the Java client kept.
Every script reads the key from the environment, retries on 429 and 5xx, ships its
tests, and CI runs them with a live smoke job when a key is configured.
@gaelsimon
gaelsimon force-pushed the samples-by-use-case branch 2 times, most recently from cc4cf43 to 52eb8ad Compare September 14, 2026 14:26
…ic-map

These four samples called the API without the retry policy the README
promises for every script. They now retry once on 429 after Retry-After,
same as the rest.
The API never sends Retry-After; it advertises its limits with the RateLimit
headers, so the retry now reads ratelimit-reset and keeps Retry-After as a proxy
fallback that no longer crashes on an HTTP date. The Node importer refused no
longer silently updates stores when --mode is misspelled, and a batch size below
one is rejected instead of hanging Node or skipping Python batches while deletes
still run.
@gaelsimon gaelsimon self-assigned this Sep 15, 2026
ratelimit-reset is a compat header pending removal; the API's current
RateLimit header carries the same reset time in its t= parameter, so every
sample now reads that first and only falls back to the legacy header.
stores-import and stores-sync also read RateLimit's remaining count and
pause on their own once it hits zero, instead of burning all three retries
on a 429 mid-batch.
…he header

Endpoints with more than one limiter (distance matrix has requests and
elements) list every policy in RateLimit, comma-separated, and the one
that hit zero on a 429 isn't necessarily first. parse_ratelimit now reads
every policy and both retry_delay and rate_limit_remaining pick the one
that is actually exhausted, live-tested against the sandbox project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant