A python API for CMADaaS MUSIC.
Project description
nuwe-cmadaas-python
为 CMADaaS MUSIC 接口封装 Python API,提供仿 MUSIC 原生接口及高层 API 接口,支持 Python 3 和 Windows。
文档:https://nuwe-cmadaas-python.readthedocs.io
安装
克隆源码,使用 pip 命令安装 nuwe-cmadaas 包。
git clone https://github.com/perillaroc/nuwe-cmadaas-python.git
cd nuwe-cmadaas-python
pip install .
开始使用
MUSIC 接口仅适用于 CMA 内网用户,使用前请先申请账户。
使用 nuwe_cmadaas.CMADaaSClient 类从 CMADaaS 中检索数据。
需要提供 MUSIC 服务的相关参数,可以保存在当前目录 client.conf 文件中,
或者在创建 nuwe_cmadaas.CMADaaSClient 对象显式指定。参数包括:
music_server: MUSIC 接口 ip 地址,必须指定music_port:MUSIC 接口端口号,必须指定music_connTimeout:连接超时,秒,可选music_readTimeout:数据读取超时,秒,可选music_ServiceId:默认服务节点 id
下面的示例展示如何检索地面观测资料。
from nuwe_cmadaas import CMADaaSClient
client_config_path = "path/to/client.config"
user = "user name"
password = "user password"
server_id = "server id"
interface_id = "getSurfEleByTimeRange"
params = {
"dataCode": "SURF_CHN_MUL_HOR",
"elements": "Station_Id_d,Lat,Lon,Alti,Day,Hour,PRS_Sea,TEM,DPT,WIN_D_INST,WIN_S_INST,PRE_1h,PRE_6h,PRE_24h,PRS",
"timeRange": "[20190817000000,20190817020000)",
"orderby": "Station_ID_d:ASC",
"limitCnt": "10",
}
client = CMADaaSClient(
user=user,
password=password,
config_file=client_config_path
)
result = client.callAPI_to_array2D(interface_id, params)
更详细的接口使用方法请访问 CMADaaS 官网。
示例
请访问 example 目录查看示例。
License
nuwe-cmadaas-python 未做特殊声明部分代码由 Wang Dapeng (CEMC/CMA) 开发,并采用 Apache License 2.0 协议。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nuwe_cmadaas-0.3.1.tar.gz.
File metadata
- Download URL: nuwe_cmadaas-0.3.1.tar.gz
- Upload date:
- Size: 91.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d3dcd7627e56dc7da0a778b0c4c961666611b51ce36a260cfc31f262a99a6af
|
|
| MD5 |
1aa7297754f1f06f6feaaca1a4b48378
|
|
| BLAKE2b-256 |
dd1e2abb440c5528c4bfe0bc042a09f96f59b170646ee9fe722598b4b4c28d5e
|
Provenance
The following attestation bundles were made for nuwe_cmadaas-0.3.1.tar.gz:
Publisher:
release.yml on perillaroc/nuwe-cmadaas-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuwe_cmadaas-0.3.1.tar.gz -
Subject digest:
7d3dcd7627e56dc7da0a778b0c4c961666611b51ce36a260cfc31f262a99a6af - Sigstore transparency entry: 2256808046
- Sigstore integration time:
-
Permalink:
perillaroc/nuwe-cmadaas-python@dc3534efebaed8ca48e6d9c84b812691900d5593 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/perillaroc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dc3534efebaed8ca48e6d9c84b812691900d5593 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nuwe_cmadaas-0.3.1-py3-none-any.whl.
File metadata
- Download URL: nuwe_cmadaas-0.3.1-py3-none-any.whl
- Upload date:
- Size: 37.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ce9433a3495232f5c7bbba66efeda928c1d840befe5e34f2f9b3b0e0ad74ca3
|
|
| MD5 |
d5731f1cbc67ac3e545b010415acc0c4
|
|
| BLAKE2b-256 |
a24d192b78c0eaa85d006f50bb9eed13c969652da97bfaa2ea770642bd18df44
|
Provenance
The following attestation bundles were made for nuwe_cmadaas-0.3.1-py3-none-any.whl:
Publisher:
release.yml on perillaroc/nuwe-cmadaas-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuwe_cmadaas-0.3.1-py3-none-any.whl -
Subject digest:
7ce9433a3495232f5c7bbba66efeda928c1d840befe5e34f2f9b3b0e0ad74ca3 - Sigstore transparency entry: 2256808049
- Sigstore integration time:
-
Permalink:
perillaroc/nuwe-cmadaas-python@dc3534efebaed8ca48e6d9c84b812691900d5593 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/perillaroc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dc3534efebaed8ca48e6d9c84b812691900d5593 -
Trigger Event:
release
-
Statement type: