Metadata-Version: 2.2
Name: spacetrack
Version: 1.4.0
Summary: Python client for space-track.org
Author-email: Frazer McLean <frazer@frazermclean.co.uk>
License: MIT
Project-URL: Repository, https://github.com/python-astrodynamics/spacetrack
Project-URL: Documentation, https://spacetrack.readthedocs.io
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: filelock>=3.17.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: logbook>=1.8.0
Requires-Dist: outcome>=1.3.0.post0
Requires-Dist: platformdirs>=4.3.6
Requires-Dist: python-dateutil>=2.9.0.post0; python_version < "3.11"
Requires-Dist: represent>=2.1
Requires-Dist: rush>=2021.4.0
Requires-Dist: sniffio>=1.3.1

spacetrack
-------------

|PyPI Version| |Documentation| |CI Status| |Coverage| |Python Version| |MIT License|

spacetrack is a python module for `Space-Track <https://www.space-track.org>`__

Installation
~~~~~~~~~~~~

.. code:: bash

    $ pip install spacetrack

Example
~~~~~~~

.. code:: python

   >>> 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 <frazer@frazermclean.co.uk>

Documentation
~~~~~~~~~~~~~

For in-depth information, `visit the
documentation <http://spacetrack.readthedocs.org/en/latest/>`__!

Development
~~~~~~~~~~~

spacetrack uses `semantic versioning <http://semver.org>`__

.. |CI Status| image:: https://github.com/python-astrodynamics/spacetrack/workflows/CI/badge.svg?branch=master
   :target: https://github.com/python-astrodynamics/spacetrack/actions?workflow=CI
.. |PyPI Version| image:: http://img.shields.io/pypi/v/spacetrack.svg?style=flat-square
   :target: https://pypi.python.org/pypi/spacetrack/
.. |Python Version| image:: https://img.shields.io/badge/python-3.6%2B-brightgreen.svg?style=flat-square
   :target: https://www.python.org/downloads/
.. |MIT License| image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
   :target: https://raw.githubusercontent.com/python-astrodynamics/spacetrack/master/LICENSE.txt
.. |Coverage| image:: https://img.shields.io/codecov/c/github/python-astrodynamics/spacetrack/master.svg?style=flat-square
   :target: https://codecov.io/github/python-astrodynamics/spacetrack?branch=master
.. |Documentation| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat-square
   :target: http://spacetrack.readthedocs.org/en/latest/
