Current collected state Current
Observed since 20 Oct, 21:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
afrogeo
Offline-first African location verification for Python.
Offline-first African location verification for Python.
Validate country, state, city, and district (LGA) without an internet connection.
pip install afrogeo
Afrogeo provides a simple verify function that takes a dictionary and returns a Result object.
from afrogeo import verify
data = {
"country": "Nigeria",
"state": "Lagos",
"lga": "Agege"
}
result = verify(data)
if result.valid:
print(f"Validated: {result.normalized['state']} - {result.normalized['lga']}")
else:
print(f"Errors: {result.errors}")
data = {
"country": "NG", # Supports codes or full names
"state": "LA", # Supports state codes
"lga": "Agege",
"city": "Agege" # Optional
}
result = verify(data)
verify(user_input: dict) -> ResultThe user_input dictionary accepts:
country (Required): Full name or ISO code.state (Required): Full name or code.lga (Required): Local Government Area name.city (Optional): City name.Returns a Result object with:
valid: Boolean.errors: List of strings (empty if valid).normalized: Dictionary of standard location names and codes.Data is stored in afrogeo/data/. To add a new country, create a <country_code>.json file following the existing structure.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | pytest; extra == "dev" | runtime |
pytest-covEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | pytest-cov; extra == "dev" | runtime |
bdist_wheel · 12.12 KB · Python py3
sdist · 12.95 KB · Python source
Observed since 20 Oct, 21:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:6cb1245e95ff8aab07a6c66e41fed653a5f951ee9cecc48ddce842e6bfceb32e