Skip to content

Commit 8c72df9

Browse files
docs(uvx): add uvx installation command
1 parent 2e3b761 commit 8c72df9

3 files changed

Lines changed: 40 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ A Project of [OSGeo Nepal](https://osgeonepal.org).
2727
Pick the one that fits how you work.
2828

2929
```bash
30+
uvx --from osmsg osmsg --last hour # zero-install, one-shot run
3031
pip install osmsg # into your project
3132
uv tool install osmsg # standalone CLI
3233
docker run --rm -v "$PWD:/work" -w /work ghcr.io/osgeonepal/osmsg:latest --last hour
3334
```
3435

36+
`uvx` can run osmsg in a throwaway environment , no install, no virtualenv to manage. Works
37+
with any flag combination, e.g. `uvx --from osmsg osmsg --last hour --tags building --summary -f parquet -f markdown`.
38+
3539
## Quick start
3640

3741
```bash

docs/Installation.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
33
## End user
44

55
```bash
6+
uvx --from osmsg osmsg --last hour # zero-install, one-shot run
7+
# or
68
pip install osmsg
79
# or
810
uv tool install osmsg
911
```
1012

1113
Wheels include the compiled `pyosmium` extension; no system OSM tools are required.
1214

15+
`uvx` (from [uv](https://docs.astral.sh/uv/)) runs osmsg in a managed, throwaway environment. handy for
16+
ad-hoc runs, CI jobs, and cron entries where you don't want to manage a venv. If a stale resolver cache
17+
ever picks an older release, add `--refresh`:
18+
19+
```bash
20+
uvx --refresh --from osmsg osmsg --last hour
21+
```
22+
1323
## Docker
1424

1525
Pull a published image from GHCR:

osmsg/export/markdown.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,33 @@ def _sum(*cols: str) -> int:
8080
parts.append(f"\nFull stats: `{fname}.parquet`")
8181

8282
parts.append("\n#### Top 5 users")
83+
user_cols = (
84+
("rank", "rank"),
85+
("name", "name"),
86+
("changesets", "changesets"),
87+
("map_changes", "map changes"),
88+
("nodes_create", "nodes created"),
89+
("ways_create", "ways created"),
90+
("rels_create", "rels created"),
91+
("poi_create", "poi created"),
92+
("hashtags", "hashtags"),
93+
)
94+
parts.append("| " + " | ".join(label for _, label in user_cols) + " |")
95+
parts.append("| " + " | ".join("---" for _ in user_cols) + " |")
8396
for r in rows[:5]:
84-
parts.append(f"- {r['name']}: {_human(int(r.get('map_changes', 0) or 0))} map changes")
97+
cells: list[str] = []
98+
for key, _ in user_cols:
99+
v = r.get(key)
100+
if key == "hashtags":
101+
hts = v or []
102+
cells.append(", ".join(hts[:3]) + (f" (+{len(hts) - 3})" if len(hts) > 3 else ""))
103+
elif key == "name":
104+
cells.append(str(v or ""))
105+
elif key == "rank":
106+
cells.append(str(v if v is not None else ""))
107+
else:
108+
cells.append(_human(int(v or 0)))
109+
parts.append("| " + " | ".join(cells) + " |")
85110

86111
if tm_stats and any("tasks_mapped" in r for r in rows):
87112
parts.append("\n#### Top 5 TM mappers")

0 commit comments

Comments
 (0)