Observed since 20 Oct, 21:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
afrigis-search-client
A modern, async Python SDK for seamless integration with the AfriGIS Search suite of APIs. Provides robust, versioned, and strongly-typed access to Autocomplete, Geocode, Place Details, and Delivery Address Format endpoints, with automatic authentication and error handling.
AfriGIS Python Search Client is a modern, async Python SDK for seamless integration with the AfriGIS Search suite of APIs. It provides robust, versioned, and strongly-typed access to Autocomplete, Geocode, Place Details, and Delivery Address Format APIs, handling authentication, request formatting, and error mapping for you.
Install via pip (after building or from PyPI):
pip install afrigis-search-client
You can provide credentials via environment variables, .env file, or directly as parameters. Example .env:
AFRIGIS_AUTH_URL=https://auth.afrigis.services
AFRIGIS_CLIENT_ID=your-client-id
AFRIGIS_CLIENT_SECRET=your-client-secret
AFRIGIS_API_KEY=your-api-key
from afrigis_search_client import AfrigisSearchClient
import os
client = AfrigisSearchClient(
client_id=os.getenv("AFRIGIS_CLIENT_ID"),
client_secret=os.getenv("AFRIGIS_CLIENT_SECRET"),
api_key=os.getenv("AFRIGIS_API_KEY")
)
All endpoints are async and raise exceptions for error conditions. See below for details on which exceptions are raised and when.
result = await client.autocomplete.v3.autocomplete(query="446 Rigel", max_results=5)
for suggestion in result.result:
print(f"{suggestion.description} ({suggestion.country})")
result = await client.geocode.v3.geocode_address(query="446 Rigel Avenue South, Erasmusrand", max_results=5)
for address in result.result:
print(f"{address.formatted_address} - {address.location}")
result = await client.details.v3.get_details(reference="2XIAs5De9f_eEXNFubwV-ZXI41F281017")
print(result.result.formatted_address)
print(result.result.location)
result = await client.delivery.v1.get_delivery(reference="2XIAs5De9f_eEXNFubwV-ZXI41F281017")
print(result.result.formatted_address)
print(result.result.delivery)
result = await client.autocomplete.v3.autocomplete(
query="446 Rigel",
max_results=5,
include_types=["street_address_level_1", "locality"],
exclude_types=["administrative_area_level_1"]
)
All endpoints raise exceptions for error conditions:
ValueError: For invalid input (e.g., empty query)Exception: For API errors, network errors, or response validation errorsDownload counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
aiohttpEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | aiohttp>=3.12.0 | runtime |
pydanticEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | pydantic>=2.0.0 | runtime |
python-dotenvEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | python-dotenv>=1.0.0 | runtime |
bdist_wheel · 12.99 KB · Python py3
sdist · 11.67 KB · Python source
Shared repository data · GitHub
Observed since 20 Oct, 21:11 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:482ed70de32e1faec50d53a15a32a34a9193dccd56a4de6b36341db0a40a167c