Skip to content

Commit 4ad6c24

Browse files
aborrusoclaude
andcommitted
chore: bump version to v0.1.1
Add an Examples: section to every CLI subcommand's help (LLM-friendly), mirroring opensdmx. convert help now notes that global options like -o/--output must precede the subcommand. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c69dcb4 commit 4ad6c24

4 files changed

Lines changed: 82 additions & 11 deletions

File tree

LOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# LOG
22

3+
## 2026-06-08 — v0.1.1
4+
5+
- Subrelease patch: aggiunta sezione `Examples:` nel docstring di **ogni** sottocomando CLI (`systems`, `convert`, `inspect`, `detect`, `targets`, `roundtrip`, `batch`, `geojson`, `cache`, `doctor`) — almeno un esempio utile per LLM, sul modello di `opensdmx`.
6+
- `convert`: nota esplicita che le opzioni globali (`-o/--output`) vanno **prima** del sottocomando (`openverto -o jsonl convert ...`), non dopo — causa frequente di `No such option: -o`.
7+
38
## 2026-06-08
49

510
- Porting Python del CLI Go `printing-press/library/verto`**openverto** (libreria + CLI, stile `opensdmx`).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openverto"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "Python CLI and library for the official IGM Verto Online coordinate transforms between Italian reference systems"
55
readme = "README.md"
66
authors = [

src/openverto/cli.py

Lines changed: 75 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,13 @@ def _main(
221221
# --------------------------------------------------------------------------- #
222222
@app.command()
223223
def systems(refresh: bool = typer.Option(False, "--refresh", help="Force a live fetch (ignore cache)")):
224-
"""List the Italian reference systems supported by Verto Online."""
224+
"""List the Italian reference systems supported by Verto Online.
225+
226+
Examples:
227+
228+
openverto systems
229+
openverto -o jsonl systems
230+
"""
225231
try:
226232
rows = lib_systems(refresh=refresh)
227233
except Exception as exc: # noqa: BLE001
@@ -236,7 +242,19 @@ def convert(
236242
to_epsg: str = typer.Option(..., "--to", help="Target EPSG (e.g. 6706)"),
237243
no_cache: bool = typer.Option(False, "--no-cache", help="Bypass the offline conversion cache"),
238244
):
239-
"""Convert one or more coordinates between reference systems (e=est/lon, n=nord/lat)."""
245+
"""Convert one or more coordinates between reference systems (e=est/lon, n=nord/lat).
246+
247+
Axis order is always e (est/lon) first, n (nord/lat) second.
248+
249+
Examples:
250+
251+
openverto convert --from 23033 --to 6706 290000 4640000
252+
openverto -o jsonl convert --from 4265 --to 6706 12.4924 41.8902
253+
printf '290000,4640000\\n' | openverto -o csv convert --from 23033 --to 6706
254+
255+
Note: global options like -o/--output go BEFORE the subcommand
256+
(openverto -o jsonl convert ...), never after it.
257+
"""
240258
in_e = _parse_epsg(from_epsg)
241259
out_e = _parse_epsg(to_epsg)
242260
pairs = _read_coord_args(coords or [])
@@ -257,7 +275,13 @@ def convert(
257275

258276
@app.command()
259277
def inspect(epsg: list[str] = typer.Argument(..., help="One or more EPSG codes")):
260-
"""Show datum family, axis order, units, zone and false easting for an EPSG."""
278+
"""Show datum family, axis order, units, zone and false easting for an EPSG.
279+
280+
Examples:
281+
282+
openverto inspect 3003
283+
openverto -o json inspect 3003 6706
284+
"""
261285
cards = []
262286
for a in epsg:
263287
code = _parse_epsg(a)
@@ -270,13 +294,25 @@ def inspect(epsg: list[str] = typer.Argument(..., help="One or more EPSG codes")
270294

271295
@app.command()
272296
def detect(e: float = typer.Argument(...), n: float = typer.Argument(...)):
273-
"""Guess the likely source reference system of a coordinate from its magnitude."""
297+
"""Guess the likely source reference system of a coordinate from its magnitude.
298+
299+
Examples:
300+
301+
openverto detect 290000 4640000
302+
openverto -o json detect 1500000 4640000
303+
"""
274304
_emit(lib_detect(e, n))
275305

276306

277307
@app.command()
278308
def targets(epsg: str = typer.Argument(..., help="Source EPSG")):
279-
"""List the reference systems you can convert a given EPSG into."""
309+
"""List the reference systems you can convert a given EPSG into.
310+
311+
Examples:
312+
313+
openverto targets 3003
314+
openverto -o csv targets 3003
315+
"""
280316
code = _parse_epsg(epsg)
281317
try:
282318
rows = lib_targets(code)
@@ -296,7 +332,13 @@ def roundtrip(
296332
The residual is the gap between the original coordinate and itself after the
297333
forward + inverse transform (datum shift + projection). residual_e/residual_n
298334
are exact in the source unit; residual_m is an approximate distance in metres
299-
(for geographic sources, a latitude-aware spherical approximation)."""
335+
(for geographic sources, a latitude-aware spherical approximation).
336+
337+
Examples:
338+
339+
openverto roundtrip --from 23033 --to 6706 290000 4640000
340+
openverto -o json roundtrip --from 3003 --to 6707 1500000 4640000
341+
"""
300342
in_e = _parse_epsg(from_epsg)
301343
out_e = _parse_epsg(to_epsg)
302344
pairs = _read_coord_args(coords or [])
@@ -330,7 +372,14 @@ def batch(
330372
skip_invalid: bool = typer.Option(False, "--skip-invalid", help="Bisect and skip coordinates the service rejects"),
331373
rejects: str = typer.Option("", "--rejects", help="Write skipped rows to this CSV"),
332374
):
333-
"""Convert a whole CSV of coordinates to CSV or GeoJSON (auto-chunks at 32000)."""
375+
"""Convert a whole CSV of coordinates to CSV or GeoJSON (auto-chunks at 32000).
376+
377+
Examples:
378+
379+
openverto batch catasto.csv --from 3003 --to 6707 --e-col est --n-col nord --out out.csv
380+
openverto batch points.csv --from 3003 --to 6706 --format geojson --out out.geojson
381+
openverto batch mixed.csv --from 4265 --to 6706 --skip-invalid --rejects bad.csv
382+
"""
334383
in_e = _parse_epsg(from_epsg)
335384
out_e = _parse_epsg(to_epsg)
336385
if fmt not in ("csv", "geojson"):
@@ -415,6 +464,11 @@ def geojson(
415464
416465
GeoJSON positions (x, y) equal (e, n) — longitude, latitude for geographic
417466
systems — matching the service's axis order directly, with no swap needed.
467+
468+
Examples:
469+
470+
openverto geojson aree.geojson --from 4230 --to 6706 --out out.geojson
471+
cat aree.geojson | openverto geojson - --from 4230 --to 6706
418472
"""
419473
in_e = _parse_epsg(from_epsg)
420474
out_e = _parse_epsg(to_epsg)
@@ -445,7 +499,13 @@ def cache(
445499
stats: bool = typer.Option(False, "--stats", help="Show cache statistics"),
446500
clear: bool = typer.Option(False, "--clear", help="Delete cached systems and conversions"),
447501
):
448-
"""Inspect or clear the local offline cache of conversions and systems."""
502+
"""Inspect or clear the local offline cache of conversions and systems.
503+
504+
Examples:
505+
506+
openverto cache --stats
507+
openverto cache --clear
508+
"""
449509
if clear:
450510
removed = cache_mod.clear()
451511
_emit({"cleared": removed})
@@ -455,7 +515,13 @@ def cache(
455515

456516
@app.command()
457517
def doctor():
458-
"""Verify connectivity to the IGM Verto Online service."""
518+
"""Verify connectivity to the IGM Verto Online service.
519+
520+
Examples:
521+
522+
openverto doctor
523+
openverto -o json doctor
524+
"""
459525
info = {"version": __version__, "service": "IGM Verto Online"}
460526
try:
461527
sysrows = lib_systems(refresh=True)

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)