Skip to main content

spacetrack

PyPI Version Documentation CI Status Coverage Python Version MIT License

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()

Authors

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)

Source distribution for spacetrack 2.1.0
File Size Uploaded
spacetrack-2.1.0.tar.gz 99.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spacetrack 2.1.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.7

2 release files

0.13.6

2 release files

0.13.5

2 release files

0.13.4

1 release file

0.13.3

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page