Metadata-Version: 2.4
Name: global-intel-exchange
Version: 0.1.0
Summary: Python client for the Global Intelligence Exchange x402 M2M API — real-time US sanctions list screening, NIST CVE lookups, and SEC/Companies House registry checks for autonomous agents.
Author-email: JOSEPH_KAMAU_KIGIMA <jkigima@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/JOSEPH-CEO/M2M2-Engine
Project-URL: Documentation, https://github.com/JOSEPH-CEO/M2M2-Engine/blob/main/docs/API_REFERENCE.md
Keywords: x402,m2m,sanctions,ofac,cve,compliance,agent,autonomous-agent,ai-agent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28
Dynamic: license-file

# global-intel-exchange (Python)

Python client for the Global Intelligence Exchange x402 M2M API.

## Install (from source, not yet published)

```bash
cd sdks/python
pip install -e .
```

## Usage

```python
from global_intel_exchange import IntelligenceExchangeClient

client = IntelligenceExchangeClient(base_url="https://your-deployment.example.com")

result = client.query(
    type="compliance",
    query="Example Trading Co",
    payment_hash="0x...",
    machine_signature="0x...",
    payment_value_eth=0.01,
)

if result.get("dataSource") != "LIVE_VERIFIED":
    print("Warning: this was an AI estimate, not a real registry check:", result.get("sourceDetail"))

print(result["data"])
```

### Checking the compliance audit trail

```python
chain = client.verify_compliance_audit_chain()
assert chain["valid"], f"Audit chain integrity broken at index {chain['brokenAtIndex']}"

record = client.get_compliance_audit_record(result["transactionId"])
print(record["recordHash"])
```

## Error handling

Network errors and 5xx responses raise `IntelligenceExchangeError` (with
`.status_code` and `.body`). 4xx application-level responses (e.g.
`status: "payment_required"` or `"unprofitable"`) are returned normally as a
dict — check `result["status"]` rather than relying on an exception for
those, since they're expected outcomes, not failures.

## See also

- `../../docs/API_REFERENCE.md` — full endpoint reference
- `../../docs/DATA_SOURCES.md` — what `dataSource` actually means per vector
- `../../docs/COMPLIANCE_AUDIT.md` — the audit hash-chain model
