OccultSky
OccultSky is a Python toolkit for searching historical lunar occultation events of planets, powered by Skyfield. Given a date and an observing site, it computes the rise/set times, positions, and mutual angular distances of the Moon and planets, and renders night-sky charts.
Features
- High-precision ephemeris — JPL DE441 SPICE kernel covering 13,200 BCE – 17,191 CE, suitable for historical dates.
- Historical-friendly time model — dates before 1582-10-15 follow the Julian calendar; local times use Local Mean Time (LMT) derived directly from the site's longitude.
- Two chart types:
timeline— a single-axis chart of the night with Moon/planet rise and set milestones and shaded night/twilight bands;preview— a two-panel sky chart in a WCS projection showing the Moon's nightly track (as a buffered band), planet positions, and sky-culture layers (constellation lines, star names, asterisms, the 28 lunar mansions).
- CLI + Python API — a Typer command-line interface and an
Observerclass for programmatic use.
Requirements
- Python >= 3.13 (pinned by
.python-version) - uv (recommended) or pip
Installation
uv sync # create .venv and install dependencies from uv.lock
uv run occultsky --help # verify the CLI entry point
Configuration
OccultSky needs a local data directory for Skyfield caches. Set it in one of these ways (highest priority first):
- CLI option:
--skyfield-data <dir> - Environment variable:
SKYFIELD_DATA=<dir> .envfile in the working directory (loaded via python-dotenv):
SKYFIELD_DATA=C:\path\to\occultsky-data
# PowerShell example
$env:SKYFIELD_DATA = "C:\path\to\occultsky-data"
On first run, Skyfield downloads the required data into this directory automatically:
de441.bsp— JPL ephemeris (also downloadable manually from NASA JPL NAIF);hip_main.dat— Hipparcos star catalogue;skyculture_<culture>.json— Stellarium sky-culture data.
If SKYFIELD_DATA is not configured, the toolkit raises a ValueError with instructions.
Quick Start
Dates are local dates in YYYY-MM-DD; zero-pad years shorter than four digits (e.g. 0303-12-05).
Timeline chart
uv run occultsky timeline 0303-12-05 --lat 39.93 --lon 116.37 --elevation 52 --planets venus -o timeline.png
Sky preview chart
uv run occultsky preview 0303-12-05 --lat 39.93 --lon 116.37 --elevation 52 --planets venus --stars --constellation --mansions -o preview.png
Without -o, charts are shown in an interactive window instead of being saved.
CLI Options
Common options (both commands):
| Option | Description |
|---|---|
DATE (argument) |
Local date in YYYY-MM-DD |
--lat, --lon, --elevation |
Observing site: latitude/longitude in degrees (north/east positive), elevation in meters (all required) |
--planets, -p |
Comma-separated planet names, e.g. mars,jupiter (lowercase English) |
--skyfield-data |
Skyfield data directory (falls back to the SKYFIELD_DATA env var) |
--ephemeris |
JPL ephemeris filename (default: de441.bsp) |
--output, -o |
Save the chart to a file instead of showing a window |
--verbose, -v |
Enable verbose logging |
preview additionally accepts:
| Option | Description |
|---|---|
--interval |
Sampling step in minutes (default: 15) |
--projection |
WCS projection code (default: STG) |
--fov |
Field of view in degrees (default: 6) |
--stars, --constellation, --asterism, --mansions |
Toggle sky-culture layers |
--skyculture |
Stellarium sky culture (default: chinese) |
Run uv run occultsky <command> --help for the full option list.
External Data
| Data | Source | Purpose |
|---|---|---|
de441.bsp |
NASA JPL NAIF SPICE | Lunar and planetary ephemeris, 13,200 BCE – 17,191 CE |
hip_main.dat |
Hipparcos catalogue (via Skyfield) | Star positions and magnitudes |
skyculture_<culture>.json |
Stellarium sky cultures | Constellation lines, star names, lunar mansions |
Star Name Annotations
Star names are passed through verbatim from Stellarium's sky-culture data. In the chinese culture, suffixes mark stars added from Pan Nai's The History of Stellar Observation in China (中国恒星观测史): * = certified, ? = uncertain identification (e.g. 天籥二?). See Stellarium's chinese sky-culture description.
These suffixes are kept in charts on purpose: for historical-record verification, an uncertain identification is itself evidence and must not be silently dropped.
Metadata
Release files for occultsky 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| occultsky-0.1.0.tar.gz | 87.9 kB | Without provenance | Details for occultsky-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| occultsky-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for occultsky-0.1.0-py3-none-any.whl |
Total release size: 109.5 kB
Release files / occultsky-0.1.0.tar.gz
| Download URL | occultsky-0.1.0.tar.gz |
|---|---|
| Size | 87.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a56bc362c7d6d6df6570d8772db2ef6a48c94ed909e38ae5e5225aa80b00f17
|
|
BLAKE2b-256 checksum How to use checksums |
1dfb86e6914f784f30584316f1083f12541b3ac38dcdf3ae566cace68a387722
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / occultsky-0.1.0-py3-none-any.whl
| Download URL | occultsky-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f79910f5ae14e062457aaec3c4fe2442ee1ca58b762bdf29933b60cc39dfd93f
|
|
BLAKE2b-256 checksum How to use checksums |
aec50fc42b98c14ac7daf5a8431ae1328f7de0b4cbc1cb3c53d7f2ed3ff7dd2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for occultsky 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.