← All packages

Orbits & astrodynamics

star-twobody 0.1.0

The sizes and speeds of a Keplerian ellipse

Public state: Released & Verified. The registry label is RELEASED. What the states mean →

Apache-2.0 Released & Verified single file

Summary

Period, mean motion, circular and escape speed, apsis radii and speeds and specific energy of a two-body ellipse; within 4e-14 relative of SPICE for any gravitational parameter and 2.6e-14 of hapsira on 600 orbits; reproduces the geostationary orbit and refuses non-elliptic input.

Run in your browser

Edit the code and press Run (or Ctrl+Enter). Python runs in your browser with this package's published code. The first run downloads Python once (about 12 MB).

Runs in the browser: all 26 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026.

Use it on your computer

No account and no GitHub needed. Download, then install with one command:

python -m pip install star_twobody-0.1.0-py3-none-any.whl

In Python: import star_twobody

Get started →

Cite it, and its bill of materials

For a paper, a report or a supplier file: the citation in two formats, and the software bill of materials (SBOM) in the two standard formats, with the fingerprint of the wheel.

@software{cavazzini_star_twobody_0_1_0,
  author  = {Cavazzini, Andrea},
  title   = {{star-twobody}: The sizes and speeds of a Keplerian ellipse},
  version = {0.1.0},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_twobody/},
  note    = {Apache-2.0. Source: https://github.com/Andrea07072000/S.T.A.R.-, commit dc09f61d}
}

For developers

Install directly from the public repository:

python -m pip install "star-twobody @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_twobody"

README · tests · evidence (GitHub)

Technical sheet

Package
star-twobody
Import name
star_twobody
Version
0.1.0
Licence
Apache-2.0
Python
>=3.9
Dependencies
none (standard library only)
Capability
star.orbit.twobody-quantities
Maturity
Released & Verified (RELEASED)
Published commit
dc09f61d

Requirements

  • R1 period, semi_major_axis_from_period, mean_motion: Kepler's third law, for the Earth by default or any mu. Reproduce the geostationary orbit (one sidereal day at 42164.17 km).
  • R2 circular_speed, escape_speed, apsides, elements_from_apsides, apsis_speeds, specific_energy, consistent with each other: angular momentum and energy are the same at the two apsides.
  • R3 Measured on 600 orbits (a 6600 to 400000 km, e 0 to 0.95, 100 circular): within 4e-14 relative of SPICE for a gravitational parameter from the Moon's to the Sun's, and within 2.6e-14 of hapsira on the Earth.
  • R4 Every function returns finite floats or raises ValueError: non-numeric, boolean, NaN or infinite input, a length, period or mu outside [1e-30, 1e30] (zero and negative values included), an eccentricity outside [0, 1), an apoapsis below the periapsis by more than rounding.

Limits (what is not claimed)

Two-body motion only: the real period of a low orbit differs by seconds because of the Earth's oblateness (see star_j2 for the nodal period). Ellipses only: no parabolic or hyperbolic orbits. No position along the orbit (see star_kepler) and no manoeuvres (see star_maneuver). The result is as good as the mu supplied.

Release gate

Computed by the registry from the result files, with the same function that decides RELEASED.

Mutation score, latest measure of each module (needs at least 0.850)
  • star_twobody.py 0.932 (2026-10-06)
Independent implementations written by others (needs 2)
hapsira Orbit.from_classical (Earth), SPICE conics / oscltx (C, any mu)
Also compared with, not counted
published values: geostationary orbit: sidereal day at 42164.17 km
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Clean install from the release tagVERIFIED2026-10-06pytest outside the tree: 26 passed in 0.13s
Unit testsVERIFIED2026-10-0626 passed in 0.35s
ReviewVERIFIED2026-10-06Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed
ReviewVERIFIED2026-10-06Re-running the cross-check gives a byte-identical evidence file
Reference valueVERIFIED2026-10-06period(42164.17) = 86164.0917 s: within 0.0012 s of the sidereal day (suite: 26 passed in 0.35s)
Cross-check with independent librariesVERIFIED2026-10-06star_twobody gives the period, the sizes and the speeds of a Keplerian ellipse as two independent libraries do
BenchmarkVERIFIED2026-10-06largest relative difference: SPICE 3.8e-14, hapsira 2.5e-14

Fingerprints (SHA-256)

star_twobody-0.1.0-py3-none-any.whl991a4eba18e982fd92143c763495addf8afa1d82c02dd6f389b96ebd07d317d7
star_twobody.pya5fbb4728763581f60553dfc5abfe3fad23c6a34055d5b8524d68dedfcdc947e
star_twobody-0.1.0-source.zipcdd096b7a470bb07de3ee29982c145acf4c7288b0051b39875dae44eee83214d

results