Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

warnely-cli

License: CC BY 4.0 Python 3.8+

Command-line client for the Warnely Public API: composite travel-safety scores for 180 countries combining UK FCDO, US State Department, Global Peace Index, World Bank Worldwide Governance Indicators, and a live news incident wire.

Single-file, zero dependencies. Pure Python stdlib. Installs to a single warnely binary.

Install

# From git (no PyPI needed)
pip install "git+https://github.com/sn-lui/warnely-cli.git"

Or just download warnely_cli.py, drop it on your PATH, and run it directly:

curl -O https://raw.githubusercontent.com/sn-lui/warnely-cli/main/warnely_cli.py
chmod +x warnely_cli.py
./warnely_cli.py TH

Use

# One country, full snapshot
warnely TH
# One-line summary
warnely TH --short
# πŸ‡ΉπŸ‡­ Thailand (TH) β€” 38/100 Β· Exercise Increased Caution
# All 180 countries, sorted by score
warnely list
# Filter to a region
warnely list --region Asia
# Live incident wire
warnely incidents
warnely incidents --country TH --limit 10
# Methodology document
warnely methodology
# Raw JSON for piping into jq / scripts / notebooks
warnely TH --json | jq .country.risk_score
warnely list --json | jq '.[] | select(.region=="Europe") | .iso2'

Output

By default the CLI uses colour codes when stdout is a TTY. Pipe through anything (| less, | jq, > file.txt) and colours are stripped automatically. The NO_COLOR environment variable is respected.

Reference

Command What it does
warnely <ISO> Shortcut for warnely country <ISO>
warnely country <ISO> Full snapshot for one country
warnely list All 180 countries (tabular)
warnely incidents Recent items from the safety wire
warnely methodology Composite formula + sources + tiers

All commands accept --json for raw API output.

Why a CLI

The Warnely API is fine for scripts, but for one-off questions ("how safe is Thailand?") the round trip through curl + jq is friction. This CLI makes the common cases trivial and respects shell idioms (pipeable, NO_COLOR, sensible exit codes).

Attribution

The Warnely dataset is licensed CC BY 4.0. If you publish work derived from it, attribute Warnely with a link to https://warnely.com.

Related

About

Command-line client for the Warnely Public API: composite travel-safety scores for 180 countries. Single file, zero deps, CC BY 4.0.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /