This project uses multiple virtual environments so the core backend stays lean while UI wrappers remain optional.
venv(base): core backend onlyvenv-streamlit: Streamlit UIvenv-kivy: Kivy UIvenv-docs: documentation export (imports UI modules)
Use the Makefile to create isolated environments with pinned dependencies:
make venv(createsvenvwithrequirements/base.txt)make venv-streamlit(createsvenv-streamlitwithrequirements/streamlit.txt)make venv-kivy(createsvenv-kivywithrequirements/kivy.txt)make venv-docs(createsvenv-docswith.[docs]extras)
- A single venv cannot switch environments without uninstalling packages.
- Separate venvs avoid heavy or conflicting UI dependencies.
- Create virtual environment:
python3 -m venv venv- Activate virtual environment:
- Windows:
venv\Scripts\activate - Linux:
source ./venv/bin/activate
- Install libraries:
- Using precompiled lockfiles (recommended):
- Base only:
pip install -r requirements/base.txt - Streamlit UI:
pip install -r requirements/streamlit.txt - Kivy UI:
pip install -r requirements/kivy.txt - Dev all‑in:
pip install -r requirements/dev.txt(or top‑levelrequirements.txtif present)
- Base only:
- To (re)compile lockfiles with pip‑tools:
- Base:
pip-compile requirements/base.in -o requirements/base.txt - Streamlit:
pip-compile requirements/streamlit.in -o requirements/streamlit.txt - Kivy:
pip-compile requirements/kivy.in -o requirements/kivy.txt - Dev all‑in: create
requirements/dev.inthat includes-r requirements/streamlit.inand-r requirements/kivy.in, then:pip-compile requirements/dev.in -o requirements/dev.txt
- Base:
- Run the application:
- Default:
python3 -m module(runs TUI) - Streamlit UI:
python3 -m module --streamlit - Kivy UI:
python3 -m module --kivy - TUI explicitly:
python3 -m module --tui
- Run tests:
- See
docs/TESTING_GUIDE.mdfor detailed instructions - Quick start:
python3 -m unittest discover tests -v - Or use Makefile:
make run_tests
- Project structure (core modules):
services.py— chart creation/selection and compute orchestrationutils.py— utilities for date and location parsingworkspace.py— workspace, chart and settings managementz_visual.py— visualization
- Dependency definitions live in
requirements/as.infiles:requirements/base.incontains core runtime deps.requirements/streamlit.inandrequirements/kivy.inshould start with-r base.in.
- Reproducible installs use compiled lockfiles in
requirements/*.txt. - Dev/all‑in: keep
requirements/dev.txtunderrequirements/. Optionally provide a rootrequirements.txtthat contains-r requirements/dev.txt.
- A single venv cannot "switch" environments without uninstalling packages; once installed, they persist.
- Recommended: use separate venvs per UI target (
base,streamlit,kivy,docs) to avoid heavy or conflicting deps. - If you still want one venv, install the base first, then add extras:
pip install -e .(core only)pip install -e ".[streamlit]"orpip install -e ".[kivy]"pip install -e ".[docs]"(includes UI deps somake docscan import UI modules)
pyproject.toml is derived from requirements/*.in (not from the compiled .txt lockfiles).
To regenerate the dependency sections after updating .in files:
make sync-pyproject-
Install dependencies (choose one):
- Option A: using pip‑tools
pip-compile requirements/streamlit.in -o requirements/streamlit.txtpip install -r requirements/streamlit.txt# contains base via-r base.in
- Option B: directly from the precompiled lockfile
pip install -r requirements/streamlit.txt
- Option A: using pip‑tools
-
Run Streamlit:
python3 -m module --streamlit
-
Features:
- Engine switcher (Kerykeion default vs JPL/Skyfield) in Advanced settings.
- Default JPL ephemeris file:
source/de421.bsp(override via the ephemeris path field). - Standardized Radix chart rendered with Plotly interactively.
-
Install dependencies (choose one):
- Option A: using pip‑tools
pip-compile requirements/kivy.in -o requirements/kivy.txtpip install -r requirements/kivy.txt# contains base via-r base.in
- Option B: directly from the precompiled lockfile
pip install -r requirements/kivy.txt
- Option A: using pip‑tools
-
Enable embedded interactive Plotly inside Kivy (recommended):
- Install Kivy Garden tooling and the WebView widget:
pip install kivy-gardengarden install kivy_garden.webview
- If WebView is unavailable, the app falls back to opening the chart in the browser.
- Install Kivy Garden tooling and the WebView widget:
-
Run Kivy:
python3 -m module --kivy
-
Features:
- JPL engine toggle in the top toolbar (JPL on/off).
- Standardized Radix chart renderer.
- Default JPL ephemeris file path:
source/de421.bsp.
-
Unknown class
WebViewin KV:- Install the widget via Kivy Garden:
pip install kivy-gardenthengarden install kivy_garden.webview. - Alternatively, rely on the browser fallback.
- Install the widget via Kivy Garden:
-
Kerykeion Geonames warning:
- Set a custom geonames username to avoid default shared rate limits. See the Kerykeion docs.
-
JPL not active / ephemeris file not found:
- Ensure
skyfieldis installed and thatsource/de421.bspis present. - You can change the path in Advanced settings (Streamlit) or in Kivy code.
- Ensure
-
Streamlit not updating:
- Clear the browser cache or stop/restart the Streamlit server.
The Hugo site sources live under docs/site/ and the build output is written to docs/.
# Create docs venv (includes extras needed for doc export)
make venv-docs
source venv-docs/bin/activate
# Generate docs/site/content/auto, docs/site/content/models.mmd, docs/site/content/enums.md
make docsIf you created venv-docs before syncing pyproject.toml, re-run
make venv-docs to force-reinstall dependencies (this installs new base deps
like duckdb).
# From repo root
hugo server --source docs/site --config hugo.toml --baseURL http://localhost:1313/ --appendPort=falseThis serves the docs site locally at http://localhost:1313. If you skip the override, Hugo uses the GitHub Pages baseURL and you'll need to open http://localhost:1313/function-wrapper/ instead.
hugo --source docs/site --config hugo.toml --destination docsThe static site is generated in docs/ (the GitHub Pages publishing root).
- Repository Settings → Pages → Source: Deploy from a branch
- Branch:
main(or your default branch) - Folder:
/docs - Save and wait for the Pages deployment to finish
Notes:
docs/contains the built site; Hugo sources live indocs/site/.- Because the source tree is under
docs/, the raw source files are also publicly visible.