space-track.org的python客户端

spacetrack的Python项目详细描述


PyPI VersionDocumentationTravisCoveragePython VersionMIT License

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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Cassandra DB的javascript查询结果   java定时器任务调度   java在TLS上实现LDAP   为什么在浏览器中滚动会使java小程序闪烁?   未使用轮询器和serviceactivator提取java pubsub消息   java风暴多线程问题   java计算平均成绩   java将字符串添加到另一个类的数组列表中   文件Java路径如何转换为例如InputStream   java更改JComboBox的字体颜色   java inthttp:具有可轮询请求通道的inboundgateway   使用继承在Java中运行swing Base和扩展windows   java ivysettings。xml:添加本地maven路径   java如何将参数自定义视图传递给activity类   java延迟加载无法在Hibernate中使用一对一映射   当文件以“file:/”开头时,Java无法识别该文件   需要java正则表达式帮助,使用反斜杠   片段中的java GWT参数