aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md14
-rw-r--r--scripts/prep.py4
2 files changed, 12 insertions, 6 deletions
diff --git a/README.md b/README.md
index c942e7f..275e3a2 100644
--- a/README.md
+++ b/README.md
@@ -16,19 +16,21 @@ The app is static HTML/JS; all calculations run in the browser.
## Quick start
-The weather data is not part of this repository. Build it once from the original sources
-(needs Python ≥ 3.10 and numpy; downloads about 700 MB into `.cache/`, writes about
-150 MB to `web/data/`, takes a few minutes):
+Requires [uv](https://docs.astral.sh/uv/). The weather data is not part of this
+repository. Build it once from the original sources (downloads about 700 MB into
+`.cache/`, writes about 150 MB to `web/data/`, takes a few minutes):
```sh
-python3 -m venv .venv && .venv/bin/pip install numpy
-.venv/bin/python scripts/prep.py
+uv run scripts/prep.py
```
+uv picks a suitable Python and installs the script's dependencies (numpy) from the
+metadata at the top of `scripts/prep.py`.
+
Then serve the `web/` directory and open http://127.0.0.1:8765:
```sh
-python3 -m http.server 8765 -d web
+uv run python -m http.server 8765 -d web
```
Re-running `scripts/prep.py` reuses the downloads in `.cache/`; delete that directory to
diff --git a/scripts/prep.py b/scripts/prep.py
index a55918d..44f72aa 100644
--- a/scripts/prep.py
+++ b/scripts/prep.py
@@ -1,3 +1,7 @@
+# /// script
+# requires-python = ">=3.10"
+# dependencies = ["numpy"]
+# ///
"""Build the weather data for the web app from DWD open data and GeoNames.
Output (web/data/):