Skip to main content

amap-sdk-python

PyPI version Python License: MIT Tests

Python SDK for the Amap (高德地图) Web Service REST API.

Disclaimer: This is an unofficial, community-maintained SDK. 高德地图 is a trademark of AutoNavi Software Co., Ltd. (Alibaba Group). This project is not affiliated with or endorsed by Amap/AutoNavi.

Features

  • 10 API modules covering geocoding, POI search, routing, weather, and more
  • POI search uses the latest v5 API
  • Type-annotated, minimal dependencies (requests only)
  • Comprehensive test suite (68 unit + 4 integration tests)

Installation

pip install amap-sdk

For development:

git clone https://github.com/Horacehxw/amap-sdk-python.git
cd amap-sdk-python
pip install -e ".[dev]"

Quick Start

from amap import AmapClient

# Via environment variable AMAP_MAPS_API_KEY, or pass directly:
client = AmapClient(api_key="your_api_key")

# Geocoding
result = client.geocoding.geocode("北京市朝阳区阜通东大街6号")

# POI search (v5)
pois = client.poi.text_search("火锅", city="重庆")

# Weather
weather = client.weather.get_weather("110101")  # adcode for 东城区

# Routing
route = client.direction.driving("116.481028,39.989643", "116.465302,40.004717")

# Static map (returns PNG bytes)
img = client.staticmap.get_map(location="116.481028,39.989643", zoom=15)

Get your API key from the Amap Developer Portal.

API Modules

Module Attribute Description
Geocoding client.geocoding Address ↔ coordinate conversion
POI (v5) client.poi Place search: text, nearby, polygon, detail
Weather client.weather Current weather and forecasts
District client.district Administrative region queries
Input Tips client.inputtips Search autocomplete suggestions
Distance client.distance Distance measurement between points
Direction client.direction Walk, drive, transit, bicycle routing
Static Map client.staticmap Static map image generation (PNG)
Coordinate client.coordinate Coordinate system conversion (GPS/Baidu → GCJ-02)
Traffic client.traffic Real-time traffic status (road, circle, rectangle)

Testing

# Unit tests (no API key needed)
pytest -v

# Skip integration tests
pytest -v -m "not integration"

# Integration tests (requires real API key)
AMAP_MAPS_API_KEY=your_key pytest -v -m integration

License

MIT


中文说明

高德地图 Web Service REST API 的 Python SDK,覆盖地理编码、POI 搜索、路线规划、天气查询等 10 个模块。

安装:

pip install amap-sdk

特性:

  • POI 搜索使用最新 v5 API
  • 完整类型注解,仅依赖 requests
  • 72 个测试(68 单元 + 4 集成),无需 API Key 即可运行单元测试
  • 支持坐标系转换(GPS/百度 → GCJ-02)

使用前需要: 在高德开放平台注册并获取 API Key。

Metadata

Release files for amap-sdk 0.1.0

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

Source distribution (sdist)

Source distribution for amap-sdk 0.1.0
File Size Uploaded
amap_sdk-0.1.0.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amap-sdk 0.1.0
File Interpreter ABI Platform
amap_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.9 kB

Release files / amap_sdk-0.1.0.tar.gz

Download URL amap_sdk-0.1.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
41ad91cf9ae676ffe5155f3640c00f3742ec88c8647be71a0dccb135f7112763
BLAKE2b-256 checksum
How to use checksums
0f3b9b7a2190c38d4685ccd1a142af6c10135b8e34cf764a2e339f8dda5fa5d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / amap_sdk-0.1.0-py3-none-any.whl

Download URL amap_sdk-0.1.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d60a3fe51e02c0c4aa329b6f29dcd9819c587b4e9c1b7adc4ed9304a5a207df
BLAKE2b-256 checksum
How to use checksums
9dfb715e9ba8af920674fc03defcb7e393e190bd8b47ddeb7b3623cd8b9129a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.1.0 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