Skip to main content

Python client for space-track.org

Project description

PyPI Version Documentation Travis 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(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(onrad_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-0.13.2.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

spacetrack-0.13.2-py2.py3-none-any.whl (16.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: spacetrack-0.13.2.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 clint/0.5.1 CPython/3.7.1 Darwin/16.7.0

File hashes

Hashes for spacetrack-0.13.2.tar.gz
Algorithm Hash digest
SHA256 5d6cf8098be94e35d5aae12d54a42af78bd14320a49e040eab1e9ade8f28012d
MD5 44f1fcf3257670a1d09f4dd15ed49168
BLAKE2b-256 0e0435017de1ea86ce11720083e37db06e1c2d611fba652501fcf5ed28b6a41e

See more details on using hashes here.

File details

Details for the file spacetrack-0.13.2-py2.py3-none-any.whl.

File metadata

  • Download URL: spacetrack-0.13.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 clint/0.5.1 CPython/3.7.1 Darwin/16.7.0

File hashes

Hashes for spacetrack-0.13.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fb25c8ce80a016757af5e90bb3449f0ba4b8244fce160319b9182f748702adcd
MD5 82bf9e7e23a0f4a0b957b44c2df020a9
BLAKE2b-256 f52c9d9022e60686b22b2cba6123077a1023430cef51d7fd793f2cc5a452af3b

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