Python client for space-track.org
Project description
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(...)
Documentation
For in-depth information, visit the documentation!
Development
spacetrack uses semantic versioning
Project details
Release history Release notifications | RSS feed
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.5.tar.gz
(28.9 kB
view details)
Built Distribution
File details
Details for the file spacetrack-0.13.5.tar.gz
.
File metadata
- Download URL: spacetrack-0.13.5.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09b8b02839628484d457ebf4da59bdc4b4a2695176723922c05d8483260e08c1 |
|
MD5 | d9565c7524afd3f0de730a1577bd8e77 |
|
BLAKE2b-256 | 70f1aa7dce203352de938bddbfffe536679cb7f3125c1451cee180992d0ad215 |
File details
Details for the file spacetrack-0.13.5-py2.py3-none-any.whl
.
File metadata
- Download URL: spacetrack-0.13.5-py2.py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb0a7d198984ae9dc0daf285dfced6eff32a6042c0ce39e100d2d1ff96491d9 |
|
MD5 | 1b6f6d898082fc54fa1de2c56c54f0ec |
|
BLAKE2b-256 | f62b3a5ac44a98f700e5af650a4b6f47c8c26374515594f18ab60ea0ccd511b8 |