GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - python-astrodynamics/spacetrack: Python client for space-track.org

BranchesTags
Open more actions menu

Latest commit

 

History

489 Commits
489 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
newsfragments
newsfragments
 
 
src/spacetrack
src/spacetrack
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.readthedocs.yaml
.readthedocs.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.rst
README.rst
 
 
noxfile.py
noxfile.py
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

spacetrack

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

  • Frazer McLean <[email protected]>

Documentation

For in-depth information, visit the documentation!

Development

spacetrack uses semantic versioning.

About

Python client for space-track.org

Topics

space-track

Resources

Readme
MIT license
Activity
Custom properties

Stars

93 stars

Watchers

9 watching

Forks

18 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.