Skip to main content

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 协议。

Metadata

Release files for nuwe-cmadaas 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nuwe-cmadaas 0.3.1
File Size Uploaded
nuwe_cmadaas-0.3.1.tar.gz 91.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nuwe-cmadaas 0.3.1
File Interpreter ABI Platform
nuwe_cmadaas-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 128.5 kB

Release files / nuwe_cmadaas-0.3.1.tar.gz

Download URL nuwe_cmadaas-0.3.1.tar.gz
Size 91.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7d3dcd7627e56dc7da0a778b0c4c961666611b51ce36a260cfc31f262a99a6af
BLAKE2b-256 checksum
How to use checksums
dd1e2abb440c5528c4bfe0bc042a09f96f59b170646ee9fe722598b4b4c28d5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Release files / nuwe_cmadaas-0.3.1-py3-none-any.whl

Download URL nuwe_cmadaas-0.3.1-py3-none-any.whl
Size 37.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ce9433a3495232f5c7bbba66efeda928c1d840befe5e34f2f9b3b0e0ad74ca3
BLAKE2b-256 checksum
How to use checksums
a24d192b78c0eaa85d006f50bb9eed13c969652da97bfaa2ea770642bd18df44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page