Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacetrack-2.1.0.tar.gz (99.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spacetrack-2.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file spacetrack-2.1.0.tar.gz.

File metadata

  • Download URL: spacetrack-2.1.0.tar.gz
  • Upload date:
  • Size: 99.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spacetrack-2.1.0.tar.gz
Algorithm Hash digest
SHA256 21435e87b756a2b4e49f7b98c6067419ad688a4775869a3c4b8b1c28b7a51593
MD5 6a40961f34d10b472a0f1d83a97a92e3
BLAKE2b-256 0f00bc32768fadbf9d994719b067f87a6b3f2d29c869eb367f7199f3d2a09ebe

See more details on using hashes here.

Provenance

The following attestation bundles were made for spacetrack-2.1.0.tar.gz:

Publisher: publish.yml on python-astrodynamics/spacetrack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spacetrack-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: spacetrack-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spacetrack-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92bf4cf3023e8b9820d09377da1a49d1e7ad8ff0e6de72130e60311dab2ece5f
MD5 fbcfb72647522d9a9feaeb0e8af999b0
BLAKE2b-256 6d57300ec9d39f8a596ba7440b92067a0991732ed2088d5884cb5aaf9db2e30e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spacetrack-2.1.0-py3-none-any.whl:

Publisher: publish.yml on python-astrodynamics/spacetrack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

2.0.0

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.7

2 files

0.13.6

2 files

0.13.5

2 files

0.13.4

1 file

0.13.3

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.0

2 files

0.11.1

2 files

0.11.0.post0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.1.0

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page