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_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(...)
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-1.2.0.tar.gz
(27.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spacetrack-1.2.0.tar.gz.
File metadata
- Download URL: spacetrack-1.2.0.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4ee633f4d86461dc0683771609826e8df26448ceb98193960676c74e3eda14f
|
|
| MD5 |
47aadef48bc1a94b1fd568f654ec9833
|
|
| BLAKE2b-256 |
06d8b063cd86aa73eaef4640fc49d83b9a1cd4132e26de53c42ccbb62a8e0099
|
File details
Details for the file spacetrack-1.2.0-py3-none-any.whl.
File metadata
- Download URL: spacetrack-1.2.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efba3094741fd0927302f6b4abbb721595d5dccec796051d2dc477a39bd9c961
|
|
| MD5 |
2b68ab71287e2938fba8d19ec223763b
|
|
| BLAKE2b-256 |
4e0d54683f544f3cfbc4a878cf71f109aaa72f86aeb863951673ec722dcc4fff
|