Catalog PyPI
Back to packageRELEASE DETAILS

0.1.1

PyPI

afrogeo

Offline-first African location verification for Python.

Published28 May 2026
Direct dependencies2
Transitive dependenciesNot calculated

README

Version 0.1.1 documentation

Afrogeo

Offline-first African location verification for Python.

Validate country, state, city, and district (LGA) without an internet connection.

Installation

pip install afrogeo

Usage

Afrogeo provides a simple verify function that takes a dictionary and returns a Result object.

Basic Example

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}")

Full Validation (including City)

data = {
    "country": "NG",        # Supports codes or full names
    "state": "LA",          # Supports state codes
    "lga": "Agege",
    "city": "Agege"         # Optional
}

result = verify(data)

Features

  • Offline-First: Uses local JSON data for instant verification.
  • Data Normalization: Automatically converts codes to full names and vice-versa.
  • Case Insensitive: Accepts "LAGOS", "lagos", or "Lagos".
  • Dynamic Loading: Loads only the data for the country you are verifying.

API Reference

verify(user_input: dict) -> Result

The 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.

Contributing

Data is stored in afrogeo/data/. To add a new country, create a <country_code>.json file following the existing structure.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest; extra == "dev"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov; extra == "dev"runtime

Distribution files

2 collected
afrogeo-0.1.1-py3-none-any.whl

bdist_wheel · 12.12 KB · Python py3

Source file
afrogeo-0.1.1.tar.gz

sdist · 12.95 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:12 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:6cb1245e95ff8aab07a6c66e41fed653a5f951ee9cecc48ddce842e6bfceb32e

Other collected versions

View all collected versions →