Skip to main content

Python SDK for the GeoScored GEO audit API

Project description

GeoScored Python SDK

Typed async Python client for the GeoScored GEO audit API.

Installation

pip install geoscored

Quickstart

import asyncio
from geoscored import GeoScoredClient

async def main():
    async with GeoScoredClient(api_key="geo_your_key_here") as client:
        # Create a scan
        scan = await client.create_scan(
            "https://example.com",
            brand_name="Example Corp",
        )
        print(f"Scan created: {scan.id}")

        # Wait for completion
        scan = await client.poll_scan(scan.id)
        print(f"Score: {scan.overall_score} ({scan.grade})")

        # Get the full report
        report = await client.get_report(scan.id)
        for check in report.checks:
            print(f"  [{check.severity}] {check.check_name}: {check.score}")

asyncio.run(main())

Sandbox mode

Use a test key (starting with geo_test_) to get deterministic mock responses without creating real scans:

async with GeoScoredClient(api_key="geo_test_demo") as client:
    scan = await client.create_scan("https://example.com")
    # Returns instantly with status="complete" and fixed scores

API Reference

GeoScoredClient(api_key, base_url="https://geoscored.ai", timeout=30.0)

All methods are async and return typed Pydantic models.

Method Returns Description
create_scan(url, brand_name, callback_url) Scan Create a new GEO audit scan
get_scan(scan_id) Scan Get scan status and scores
list_scans(limit, status, starting_after) ScanList List scans with pagination
get_report(scan_id) Report Get full audit report
list_checks(scan_id) CheckList List all check results
get_check(scan_id, check_id) Check Get a specific check
delete_scan(scan_id) None Delete a scan
export_scans(days) ExportData Export scan history
poll_scan(scan_id, interval, timeout) Scan Poll until complete/failed

Error handling

All API errors raise GeoScoredError with structured fields:

from geoscored import GeoScoredClient, GeoScoredError

try:
    scan = await client.get_scan("nonexistent")
except GeoScoredError as e:
    print(e.status_code)  # 404
    print(e.code)         # "scan_not_found"
    print(e.message)      # "Scan not found."
    print(e.request_id)   # "req_7f3a2b1c..."

Requirements

  • Python 3.10+
  • httpx >= 0.28.0
  • pydantic >= 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geoscored-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geoscored-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file geoscored-0.1.0.tar.gz.

File metadata

  • Download URL: geoscored-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for geoscored-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac039a7b149aa79452fd9d24f1d19cf4808dd4e1af1e77a82362fb924d299c7c
MD5 86c2c3d3deb2494f3dca6b70f53be387
BLAKE2b-256 122b8e66d43372d6e9ddaed4b2b1c759aa8d205544522df6d813a59c8f3440be

See more details on using hashes here.

File details

Details for the file geoscored-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: geoscored-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for geoscored-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cacc74f6a21711756073eaeb32c6f72694028432d5e242c54039b51a101b0561
MD5 26a0dad4e24e91c5071db9332d86b276
BLAKE2b-256 e87d482cf479ab95071a05b36100378128efa8f25a41713adac30edc2770df02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page