space-track.org的python客户端
spacetrack的Python项目详细描述
spacetrack是一个python模块,用于Space-Track
安装
$ pip install spacetrack
示例
>>>fromspacetrackimportSpaceTrackClient>>>st=SpaceTrackClient('identity','password')>>>print(st.tle_latest(norad_cat_id=[25544,41335],ordinal=1,format='tle'))125544U98067A16179.00000000.0000000000000-000000-00000022554400.00000.0000000000000.0000000.000000.000000000000141335U16011A16179.00000000.0000000000000-000000-00000024133500.00000.0000000000000.0000000.000000.000000000000>>># Operators, to save manual string formatting.>>>importspacetrack.operatorsasop>>>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')>>>withopen('tle.txt','w')asfp:...forlineinlines:...fp.write(line)# Streaming downloads in chunk (note file is opened in binary mode)>>>content=st.download(iter_content=True,file_id=...,format='stream')>>>withopen('file.txt','wb')asfp:...forchunkincontent:...fp.write(chunk)>>># Parameter checking, using Space-Track's modeldef API>>>st.tle_latest(onrad_cat_id=25544)TypeError:'tle_latest'gotanunexpectedargument'onrad_cat_id'>>># Automatic rate limiting>>>forsatnoinmy_satnos:...# Gets limited to <20 requests per minute automatically by blocking...st.tle(...)
文档
有关详细信息,visit the documentation!
开发
太空轨道使用semantic versioning