Skip to main content

No project description provided

Project description

tsingroc-pymeteo

清鹏智能气象数据Python SDK

安装

pip install tsingroc-pymeteo

使用

from tsingrocpymeteo import Meteo
from shapely.geometry import box
from datetime import datetime

meteo = Meteo(
    "<后端服务地址>", "<access key>", "<secret key>"
)

# 创建查询范围,类型为shapely.Polygon
center = (115.875, 27.5)
bbox = box(center[0] - 0.4, center[1] - 0.4, center[0] + 0.4, center[1] + 0.4)

res = meteo.get(
    "archive_cn", # 数据表名
    None,
    "era5", # 气象模型名
    bbox,
    (datetime(2024, 11, 7, 0, 0, 0, 0), datetime(2024, 11, 8, 0, 0, 0, 0)), # 时间范围
)

print(res)

响应格式如下:

  • dict: 查询结果
    • table_name (str): 数据表名
    • points (List[dict]): 查询结果
      • model (str): 气象模型名
      • location (str): 坐标点的 WKT 字符串
      • data (pd.DataFrame): 查询结果
    • cost (dict): 查询耗时

注意事项

表设置为ensemble_cn时,返回结果中data对应的pandas.DataFrame中每个数据都是列表,与其他表返回结果不同,需要自行进行后续处理,如计算均值等。

示例代码:

df = res["points"][0]["data"]
df = df.map(lambda x: sum(x) / len(x) if isinstance(x, list) else x)

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

tsingroc_pymeteo-0.1.5.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

tsingroc_pymeteo-0.1.5-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file tsingroc_pymeteo-0.1.5.tar.gz.

File metadata

  • Download URL: tsingroc_pymeteo-0.1.5.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tsingroc_pymeteo-0.1.5.tar.gz
Algorithm Hash digest
SHA256 819fb1b1ab15c48bcaba68b1f3d521bd990416f20790139b70e276428d0935ca
MD5 26e5412f60218227925e303358cf51ae
BLAKE2b-256 8dd6ea26c876642366bef808a8fef109873fc19b932ca2714ef92a097c22f010

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsingroc_pymeteo-0.1.5.tar.gz:

Publisher: release-pypi.yml on tsingroc/tsingroc-pymeteo

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

File details

Details for the file tsingroc_pymeteo-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for tsingroc_pymeteo-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7d65cdd4ec32940b78e2943426fca63b16f111bc35c3a3f3d10c898f8f83eff0
MD5 d76a1705c48e16b44f3e37b6b2d35dda
BLAKE2b-256 10177d491d24a784bd7d1038e051833d820ff239b195b4c202a45fdcc5fa85d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsingroc_pymeteo-0.1.5-py3-none-any.whl:

Publisher: release-pypi.yml on tsingroc/tsingroc-pymeteo

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