MirrorEarth SDK
Python SDK for accessing Open Mirror Earth API data.
Installation
pip install .
Quick Start
使用前必备
登录镜像地球开放平台,个人中心中获取apikey
使用预报数据API
文档: 链接
from mirrorearth_sdk import forecast_api
elements = [
'temperature_2m', 'dew_point_2m', 'surface_temperature', 'temperature_80m', 'temperature_100m',
'wet_bulb_temperature_2m', 'wind_gusts_10m', 'wind_speed_10m', 'wind_direction_10m', 'wind_speed_20m',
'cloud_cover', 'cloud_cover_low', 'cloud_cover_mid', 'cloud_cover_high',
'shortwave_radiation', 'longwave_radiation_downward', 'shortwave_radiation_upward', 'longwave_radiation_upward', 'soil_temperature_0_to_10cm',
'soil_temperature_10_to_40cm', 'soil_temperature_40_to_100cm', 'soil_temperature_100_to_200cm', 'soil_moisture_0_to_10cm', 'soil_moisture_10_to_40cm',
'soil_moisture_40_to_100cm', 'soil_moisture_100_to_200cm', 'precipitation', 'snow_depth', 'pressure_msl',
'surface_pressure', 'visibility', 'relative_humidity_2m', 'vapour_pressure_deficit'
]
apikey = '请在镜像地球开放平台,个人中心获取'
resp = forecast_api(lon='118', lat='32', apikey=apikey, hourly=','.join(elements), daily='temperature_2m_max', models='ecmwf', forecast_days=15)
point1 = resp[0] # 通过下标获取第一个坐标点的数据,如果传入了多个坐标,可以循环获得数据
print(point1.metedata) # 打印元数据
print(point1.hourly_df()) # 获取hourly小时级(或者是分钟级)数据,是一个DataFrame
print(point1.daily_df()) # 获取daily逐日数据
>>> output:
Metadata(location: 0, coords: (32.0, 118.0), model: gfs025)
temperature_2m_°C dew_point_2m_°C ... visibility_m relative_humidity_2m_%
2025-05-15 08:00:00 22.450001 18.423653 ... 24135.0 78.000000
2025-05-15 09:00:00 23.150000 18.686502 ... 24135.0 76.000000
2025-05-15 10:00:00 23.049999 18.798883 ... 24135.0 77.000000
2025-05-15 11:00:00 23.900000 18.983398 ... 24135.0 74.000000
2025-05-15 12:00:00 23.150000 19.307074 ... 24135.0 79.000000
... ... ... ... ... ...
2025-05-31 04:00:00 19.448149 11.189207 ... 24135.0 58.851852
2025-05-31 05:00:00 19.299999 11.088128 ... 24135.0 59.000000
2025-05-31 06:00:00 19.322222 11.259768 ... 24135.0 59.592594
2025-05-31 07:00:00 19.449999 11.585191 ... 24135.0 60.407406
2025-05-31 08:00:00 19.549999 11.827236 ... 24135.0 61.000000
[385 rows x 44 columns]
### 使用历史数据API
文档: 链接
from mirrorearth_sdk import forecast_api
apikey = '请在镜像地球开放平台,个人中心获取'
resp = forecast_api(lon='118', lat='32', apikey=apikey, hourly='temperature_2m', daily='temperature_2m_max', start_date='2023-01-01', end_date='2023-12-31')
point1 = resp[0] # 通过下标获取第一个坐标点的数据,如果传入了多个坐标,可以循环获得数据
print(point1.metedata) # 打印元数据
print(point1.hourly_df()) # 获取hourly小时级(或者是分钟级)数据,是一个DataFrame
print(point1.daily_df()) # 获取daily逐日数据
使用历史预报数据API
文档: 链接
from mirrorearth_sdk import archive_forecast_api
apikey = '请在镜像地球开放平台,个人中心获取'
resp = archive_forecast_api(lon='118', lat='32', apikey=apikey, hourly='temperature_2m', start_hour='2025-07-01T00:00', models='archive_ifs')
point1 = resp[0] # 通过下标获取第一个坐标点的数据,如果传入了多个坐标,可以循环获得数据
print(point1.metedata) # 打印元数据
print(point1.hourly_df()) # 获取hourly小时级(或者是分钟级)数据,是一个DataFrame
print(point1.daily_df()) # 获取daily逐日数据
使用无缝数据API
无缝数据指的是从历史数据到未来预报数据无缝衔接。使用ERA5+ECMWF预报,可以覆盖1940年~未来15天,让数据不间断! 文档: 链接
from mirrorearth_sdk import seamless_api
apikey = '请在镜像地球开放平台,个人中心获取'
resp = archive_forecast_api(lon='118', lat='32', apikey=apikey, hourly='temperature_2m', forecast_days=15, past_days=15)
point1 = resp[0] # 通过下标获取第一个坐标点的数据,如果传入了多个坐标,可以循环获得数据
print(point1.metedata) # 打印元数据
print(point1.hourly_df()) # 获取hourly小时级(或者是分钟级)数据,是一个DataFrame
print(point1.daily_df()) # 获取daily逐日数据
Metadata
Release files for mirrorearth-sdk 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mirrorearth_sdk-0.1.1.tar.gz | 22.4 kB | Without provenance | Details for mirrorearth_sdk-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mirrorearth_sdk-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mirrorearth_sdk-0.1.1-py3-none-any.whl |
Total release size: 46.4 kB
Release files / mirrorearth_sdk-0.1.1.tar.gz
| Download URL | mirrorearth_sdk-0.1.1.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75283b8a9f935c5227fdaa5e0e02d539137ebd1278dd2a7388e230080b68b19c
|
|
BLAKE2b-256 checksum How to use checksums |
f9c501343ca25b91a347cea3a8a9a8945b9e8b4eed7ecfe240a897280020da34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.8
|
Release files / mirrorearth_sdk-0.1.1-py3-none-any.whl
| Download URL | mirrorearth_sdk-0.1.1-py3-none-any.whl |
|---|---|
| Size | 24.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc23ff1fa01ad1b8dceb23e288a27558f73be19193497b8759c5db9a6879f9f1
|
|
BLAKE2b-256 checksum How to use checksums |
d18f4fc1529fe25e0ef2c61dbcb539aaa779bd05200ace1a06fb7e915f5b8756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.8
|
Security for mirrorearth-sdk 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.