SatKit
raw JSON → 0.16.2 verified Fri May 01 auth: no python
SatKit is a satellite orbital dynamics toolkit for Python, providing tools for orbit propagation, coordinate transformations, TLE handling, and more. Current version is 0.16.2, with a relatively stable release cadence. It requires Python >=3.10.
pip install satkit Common errors
error ModuleNotFoundError: No module named 'satkit' ↓
cause SatKit is not installed yet, or installed in a different Python environment.
fix
Run 'pip install satkit' in the correct environment.
error ValueError: TLE line must be 69 characters long ↓
cause TLE line is shorter or longer than 69 characters (including padding).
fix
Check that each TLE line is exactly 69 characters; add trailing spaces if necessary.
error AttributeError: 'tuple' object has no attribute 'position' ↓
cause Using old code that indexed the return of propagate(), but satkit v0.16 returns a namedtuple.
fix
Update code to use state.position and state.velocity instead of index access.
Warnings
breaking In v0.16, the 'propagate' method now returns a namedtuple instead of a tuple. Access fields by name (.position, .velocity) rather than indexing [0], [1]. ↓
fix Use state.position and state.velocity instead of state[0] and state[1].
gotcha TLE lines must be exactly 69 characters long (with newline stripped). Missing or extra spaces cause parsing errors. ↓
fix Ensure TLE lines are exactly 69 characters, including trailing spaces if needed.
deprecated The function 'satkit.tools.propagate_tle' is deprecated in v0.16 and will be removed in v0.17. Use 'TLE.to_satellite().propagate()' instead. ↓
fix Replace with the new pattern: sat = TLE(line1, line2).to_satellite(); state = sat.propagate(time).
Imports
- Satellite wrong
import satkit; satkit.Satellitecorrectfrom satkit import Satellite - tle wrong
from satkit.tle import TLEcorrectfrom satkit import tle
Quickstart
from satkit import Satellite, tle
# Example: propagate a satellite from TLE
line1 = '1 25544U 98067A 24001.00000000 .00000000 00000-0 00000-0 0 9999'
line2 = '2 25544 51.6428 45.1234 0001234 100.0000 200.0000 15.50000000350000'
sat = tle.TLE(line1, line2).to_satellite()
# Propagate to a specific time (fractional day of year)
state = sat.propagate(245.0)
print(state.position, state.velocity)