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.0.0.tar.gz (94.5 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.0.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spacetrack-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e7dfab51b154de7c999426116153524e23d3a78c1d615fd4b1273cfcc2aeb200
MD5 1b2e90ff4c1e892d39184673a4f7300b
BLAKE2b-256 709d4c24c10ec51ad4ebaf1e71b5c3e577b531c87684bee70336788009acb759

See more details on using hashes here.

Provenance

The following attestation bundles were made for spacetrack-2.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: spacetrack-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 468a91493cdc204a282f1c9961db360ae5eb9c486405d0b76d96479800eef6d4
MD5 e25d9448e4d54a709d0a4e0fac027757
BLAKE2b-256 9ad2e88c8be54be288ef943526722138ab6ed0e80db39075fcd58b217cae5d57

See more details on using hashes here.

Provenance

The following attestation bundles were made for spacetrack-2.0.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.

Supported by

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