Skip to main content

Python client for space-track.org

Project description

PyPI Version Documentation CI Status Coverage Python Version MIT License

spacetrack is a python module for Space-Track

Installation

$ pip install spacetrack

Example

>>> from spacetrack import SpaceTrackClient
>>> st = SpaceTrackClient('identity', 'password')

>>> print(st.tle_latest(norad_cat_id=[25544, 41335], ordinal=1, 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
>>> drange = op.inclusive_range(dt.datetime(2016, 6, 26),
...                             dt.datetime(2016, 6, 27))

>>> # Streaming downloads line by line
>>> lines = st.tle_publish(iter_lines=True, publish_epoch=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.tle_latest(norad_cat_id=25544)
TypeError: 'tle_latest' got an unexpected argument 'onrad_cat_id'

>>> # Automatic rate limiting
>>> for satno in my_satnos:
...     # Gets limited to <20 requests per minute automatically by blocking
...     st.tle(...)

Authors

Documentation

For in-depth information, visit the documentation!

Development

spacetrack uses semantic versioning

Project details


Download files

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

Source Distribution

spacetrack-1.0.1.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

spacetrack-1.0.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spacetrack-1.0.1.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for spacetrack-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d819d1835a638ef8571b54cd9d32dabb0579a3a1bad5222608ed24fcf0699c10
MD5 1552547cdc50953e767d416f5130f407
BLAKE2b-256 9a624984d874f4c9091ea278e226cb1f9b4b313614c4d5e3110f8959d06ce3b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacetrack-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for spacetrack-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16b7dfe217ec581e58899210672a9ad8bd7cd1d243f4ef38e478a856f1a3c450
MD5 cd76fe39502f6fce07ced38bb67a5504
BLAKE2b-256 b5ecb3617c7fbb58b0b456f148c1dc0bcb09d54865c23ffedae3f72ff79d0366

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page