bpptkg监控api python客户端
bmaclient的Python项目详细描述
b客户端
bpptkg监控api python客户端
安装
通过键入以下命令从pypi安装:
pip install -U bmaclient
要求
- Python3.5+
- httplib2
- 六
提出请求
必须设置有效的API密钥或OAuth2访问令牌才能进行身份验证 请求。例如,使用api密钥:
frombmaclientimportMonitoringAPIapi=MonitoringAPI(api_key='API_KEY')content=api.fetch_bulletin()print(content)
或使用访问令牌:
frombmaclientimportMonitoringAPIapi=MonitoringAPI(access_token='ACCESS_TOKEN')content=api.fetch_bulletin()print(content)
使用api密钥只适用于只读请求。如果要修改 服务器资源,建议使用访问令牌。
您可以通过传递关键字参数来应用字段查找筛选:
content=api.fetch_bulletin(eventdate__gte='2019-07-01',eventdate__lt='2019-07-11',eventtype='MP',nolimit=True)print(content)
对于需要在url路径中设置参数的api,可以传递 方法参数中的那些参数:
content=api.fetch_tiltmeter(station='selokopo',timestamp__gte='2019-07-01')print(content)
对于启用搜索筛选的api,可以在 方法参数:
content=api.search_slope(search='RB2')print(content)content=api.search_users(search='indra')print(content)
请求方法
以下URL路径是相对于基本API URL的
http://192.168.5.10/api/v1/
。
API Name | URL Path | Python Method Name |
---|---|---|
DOAS | ^{ | ^{ |
EDM | ^{ | ^{ |
Gas Emission | ^{ | ^{ |
Gas Temperature | ^{ | ^{ |
GPS Positon | ^{ | ^{ |
GPS Baseline | ^{ | ^{ |
RSAM Seismic | ^{ | ^{ |
RSAM Seismic Band | ^{ | ^{ |
RSAM Infrasound | ^{ | ^{ |
RSAM Infrasound Band | ^{ | ^{ |
Thermal | ^{ | ^{ |
Tiltmeter Platform | ^{ | ^{ |
Tiltmeter Platform Raw | ^{ | ^{ |
Tiltmeter Borehole | ^{ | ^{ |
Seismicity | ^{ | ^{ |
Seismic Bulletin | ^{ | ^{ |
Seismic Energy | ^{ | ^{ |
Seismic Magnitude | ^{ | ^{ |
EDM Slope Correction | ^{ | ^{ |
EDM Slope Correction Detail | ^{ | ^{ |
Create EDM Slope Correction | ^{ | ^{ |
Replace EDM Slope Correction | ^{ | ^{ |
Update EDM Slope Correction | ^{ | ^{ |
Search EDM Slope Correction | ^{ | ^{ |
User Profile Info | ^{ | ^{ |
User Detail | ^{ | ^{ |
Search User | ^{ | ^{ |
有关bma api的更多信息,请参见the BMA API documentation。
支架
本项目由Indra Rudianto负责维护。如果你有什么问题 这个项目,你可以通过indrarudianto.official@gmail.com联系他。
学分
这个项目的灵感来自python-instagram 投影并使用相同的设计模式。 该项目是根据bsd许可证授权的。 有关详细信息,请参见LICENSE。
许可证
通过对项目的贡献,您同意您的贡献将是 根据麻省理工学院的许可证。 有关详细信息,请参见LICENSE。