Skip to main content

A python API for CMADaaS MUSIC.

Project description

nuwe-cmadaas-python

Documentation Status

为 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nuwe_cmadaas-0.3.1.tar.gz (91.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nuwe_cmadaas-0.3.1-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

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

Hashes for nuwe_cmadaas-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7d3dcd7627e56dc7da0a778b0c4c961666611b51ce36a260cfc31f262a99a6af
MD5 1aa7297754f1f06f6feaaca1a4b48378
BLAKE2b-256 dd1e2abb440c5528c4bfe0bc042a09f96f59b170646ee9fe722598b4b4c28d5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nuwe_cmadaas-0.3.1.tar.gz:

Publisher: release.yml on perillaroc/nuwe-cmadaas-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for nuwe_cmadaas-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ce9433a3495232f5c7bbba66efeda928c1d840befe5e34f2f9b3b0e0ad74ca3
MD5 d5731f1cbc67ac3e545b010415acc0c4
BLAKE2b-256 a24d192b78c0eaa85d006f50bb9eed13c969652da97bfaa2ea770642bd18df44

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page