spacetrack
spacetrack is a Python client for Space-Track.
Installation
$ pip install spacetrack
Example
>>> from spacetrack import SpaceTrackClient
>>> st = SpaceTrackClient('identity', 'password')
>>> print(st.gp(norad_cat_id=[25544, 41335], format='tle'))
1 25544U 98067A 16179.00000000 .00000000 00000-0 00000-0 0 0000
2 25544 00.0000 0.0000 0000000 00.0000 000.0000 00.00000000 0000
1 41335U 16011A 16179.00000000 .00000000 00000-0 00000-0 0 0000
2 41335 00.0000 0.0000 0000000 00.0000 000.0000 00.00000000 0000
>>> # Operators, to save manual string formatting.
>>> import spacetrack.operators as op
>>> from datetime import datetime
>>> drange = op.inclusive_range(datetime(2016, 6, 26), datetime(2016, 6, 27))
>>> # Streaming downloads line by line
>>> lines = st.gp_history(iter_lines=True, creation_date=drange, orderby='TLE_LINE1', format='tle')
>>> with open('tle.txt', 'w') as fp:
... for line in lines:
... fp.write(line)
>>> # Streaming downloads in chunk (note file is opened in binary mode)
>>> content = st.download(iter_content=True, file_id=..., format='stream')
>>> with open('file.txt', 'wb') as fp:
... for chunk in content:
... fp.write(chunk)
>>> # Parameter checking, using Space-Track's modeldef API
>>> st.gp(onrad_cat_id=25544)
TypeError: 'gp' got an unexpected argument 'onrad_cat_id'
>>> # Automatic rate limiting
>>> for satno in my_satnos:
... # Gets limited to <30 requests per minute automatically by blocking
... st.gp(...)
>>> # Log out and close connections
>>> st.close()
Documentation
For in-depth information, visit the documentation!
Development
spacetrack uses semantic versioning.
Release files for spacetrack 2.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 | |
|---|---|---|---|
| spacetrack-2.1.0.tar.gz | 99.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spacetrack-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 118.7 kB
Release files / spacetrack-2.1.0.tar.gz
| Download URL | spacetrack-2.1.0.tar.gz |
|---|---|
| Size | 99.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21435e87b756a2b4e49f7b98c6067419ad688a4775869a3c4b8b1c28b7a51593
|
|
BLAKE2b-256 checksum How to use checksums |
0f00bc32768fadbf9d994719b067f87a6b3f2d29c869eb367f7199f3d2a09ebe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / spacetrack-2.1.0-py3-none-any.whl
| Download URL | spacetrack-2.1.0-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92bf4cf3023e8b9820d09377da1a49d1e7ad8ff0e6de72130e60311dab2ece5f
|
|
BLAKE2b-256 checksum How to use checksums |
6d57300ec9d39f8a596ba7440b92067a0991732ed2088d5884cb5aaf9db2e30e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency log