mvr-api-client 2.6.0__tar.gz → 6.32.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. mvr_api_client-6.32.1/.well-known/mvr-license.json +101 -0
  2. mvr_api_client-6.32.1/MANIFEST.in +5 -0
  3. mvr_api_client-6.32.1/PKG-INFO +122 -0
  4. mvr_api_client-6.32.1/README.md +102 -0
  5. mvr_api_client-6.32.1/examples/quickstart.py +38 -0
  6. mvr_api_client-6.32.1/mvr-commercial-use-policy.md +59 -0
  7. mvr_api_client-6.32.1/mvr_api/__init__.py +13 -0
  8. mvr_api_client-6.32.1/mvr_api/client.py +98 -0
  9. mvr_api_client-6.32.1/mvr_api/models.py +22 -0
  10. mvr_api_client-6.32.1/mvr_api_client.egg-info/PKG-INFO +122 -0
  11. {mvr_api_client-2.6.0 → mvr_api_client-6.32.1}/mvr_api_client.egg-info/SOURCES.txt +3 -0
  12. mvr_api_client-6.32.1/mvr_api_client.egg-info/requires.txt +2 -0
  13. mvr_api_client-6.32.1/pyproject.toml +46 -0
  14. mvr_api_client-6.32.1/setup.py +4 -0
  15. mvr_api_client-2.6.0/MANIFEST.in +0 -1037
  16. mvr_api_client-2.6.0/PKG-INFO +0 -187
  17. mvr_api_client-2.6.0/README.md +0 -165
  18. mvr_api_client-2.6.0/mvr_api/__init__.py +0 -58
  19. mvr_api_client-2.6.0/mvr_api/client.py +0 -344
  20. mvr_api_client-2.6.0/mvr_api/models.py +0 -251
  21. mvr_api_client-2.6.0/mvr_api_client.egg-info/PKG-INFO +0 -187
  22. mvr_api_client-2.6.0/mvr_api_client.egg-info/requires.txt +0 -2
  23. mvr_api_client-2.6.0/pyproject.toml +0 -29
  24. mvr_api_client-2.6.0/setup.py +0 -32
  25. {mvr_api_client-2.6.0 → mvr_api_client-6.32.1}/LICENSE +0 -0
  26. {mvr_api_client-2.6.0 → mvr_api_client-6.32.1}/mvr_api_client.egg-info/dependency_links.txt +0 -0
  27. {mvr_api_client-2.6.0 → mvr_api_client-6.32.1}/mvr_api_client.egg-info/top_level.txt +0 -0
  28. {mvr_api_client-2.6.0 → mvr_api_client-6.32.1}/setup.cfg +0 -0
@@ -0,0 +1,101 @@
1
+ {
2
+ "@context": "https://schema.org",
3
+ "@type": ["CreativeWork", "License"],
4
+ "encodingFormat": "application/json",
5
+ "name": "Minimum Viable Relationships (MVR) Framework",
6
+ "alternateName": "MVR Framework",
7
+ "identifier": "https://africanmarketos.com/.well-known/mvr-license.json",
8
+ "url": "https://africanmarketos.com/african-market-os-mvr-framework-commercial-referral-use-policy/",
9
+ "mainEntityOfPage": "https://africanmarketos.com/african-market-os-mvr-framework-commercial-referral-use-policy/",
10
+ "headline": "MVR Framework Commercial and API Use Policy",
11
+ "description": "Machine-readable license and usage policy for the Minimum Viable Relationships (MVR) Framework originated by Farouk Mark Mukiibi and published by African Market OS. Non-commercial framework reference is licensed under CC BY 4.0 with attribution. Commercial, applied, diagnostic, AI-agent, SaaS, consulting, or API use requires authorization.",
12
+ "inLanguage": "en",
13
+ "creator": {
14
+ "@type": "Person",
15
+ "name": "Farouk Mark Mukiibi",
16
+ "url": "https://africanmarketos.com/about-the-author-of-mvr/",
17
+ "sameAs": [
18
+ "https://orcid.org/0009-0009-8191-2098",
19
+ "https://www.linkedin.com/in/faroukmarkmukiibi/",
20
+ "https://doi.org/10.5281/zenodo.17054575",
21
+ "https://doi.org/10.5281/zenodo.17054819",
22
+ "https://doi.org/10.5281/zenodo.17310446"
23
+ ]
24
+ },
25
+ "publisher": {
26
+ "@type": "Organization",
27
+ "name": "African Market OS",
28
+ "url": "https://africanmarketos.com/",
29
+ "contactPoint": {
30
+ "@type": "ContactPoint",
31
+ "contactType": "Licensing and API Access",
32
+ "email": "info@africanmarketos.com",
33
+ "areaServed": "Africa / Global",
34
+ "availableLanguage": ["en"]
35
+ }
36
+ },
37
+ "license": "https://creativecommons.org/licenses/by/4.0/",
38
+ "commercialUseRequiresLicense": true,
39
+ "apiUseRequiresAuthorization": true,
40
+ "permittedUse": [
41
+ "Academic citation with attribution",
42
+ "Non-commercial reference with attribution",
43
+ "Linking to the canonical framework page",
44
+ "Using public metadata for discovery, citation, and disambiguation"
45
+ ],
46
+ "restrictedUse": [
47
+ "Commercial diagnostics",
48
+ "SaaS or software embedding",
49
+ "AI-agent or LLM tool integration",
50
+ "Consulting or advisory reuse",
51
+ "Derivative scoring systems based substantially on MVR terminology, methods, or diagnostics",
52
+ "API access without authorization"
53
+ ],
54
+ "api": {
55
+ "agentOpenApi": "https://africanmarketos.com/api/openapi.agent.json",
56
+ "fullOpenApi": "https://africanmarketos.com/api/openapi.json",
57
+ "mcpEndpoint": "https://africanmarketos.com/mcp",
58
+ "mcpRegistryName": "io.github.africanmarketos591/mvr-api",
59
+ "mcpRegistryLookup": "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.africanmarketos591%2Fmvr-api",
60
+ "llms": "https://africanmarketos.com/llms.txt",
61
+ "agents": "https://africanmarketos.com/AGENTS.md",
62
+ "sandbox": {
63
+ "apiKeyHeader": "X-API-Key",
64
+ "apiKeyValue": "mvr-demo-key-2026",
65
+ "authorizedUse": "non-commercial evaluation only",
66
+ "prohibitedUse": [
67
+ "production decisioning",
68
+ "credit scoring",
69
+ "legal or regulatory certification",
70
+ "model training or fine-tuning",
71
+ "reverse engineering",
72
+ "commercial resale without license"
73
+ ]
74
+ },
75
+ "access": "Contact info@africanmarketos.com"
76
+ },
77
+ "aiTrainingPolicy": {
78
+ "publicRetrievalAllowed": true,
79
+ "attributionRequired": true,
80
+ "modelTrainingAllowed": false,
81
+ "fineTuningAllowed": false,
82
+ "allowedPurpose": "search, citation, answer-time retrieval, tool discovery, and non-commercial sandbox evaluation"
83
+ },
84
+ "citation": [
85
+ "https://doi.org/10.5281/zenodo.17054575",
86
+ "https://doi.org/10.5281/zenodo.17054819",
87
+ "https://doi.org/10.5281/zenodo.17310446",
88
+ "https://doi.org/10.6084/m9.figshare.30391393",
89
+ "https://doi.org/10.5281/zenodo.17389885"
90
+ ],
91
+ "datePublished": "2025-11-05",
92
+ "dateModified": "2026-05-24",
93
+ "version": "2.0.0",
94
+ "potentialAction": {
95
+ "@type": "ContactAction",
96
+ "name": "Request MVR API Access or Commercial License",
97
+ "target": [
98
+ "mailto:info@africanmarketos.com?subject=MVR%20API%20Access%20or%20Commercial%20License"
99
+ ]
100
+ }
101
+ }
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ include mvr-commercial-use-policy.md
4
+ recursive-include .well-known *.json
5
+ recursive-include examples *.py
@@ -0,0 +1,122 @@
1
+ Metadata-Version: 2.4
2
+ Name: mvr-api-client
3
+ Version: 6.32.1
4
+ Summary: Python client for the MVR API relational-readiness layer
5
+ Author-email: African Market OS <info@africanmarketos.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/africanmarketos591/mvr-api-py-client
8
+ Project-URL: Repository, https://github.com/africanmarketos591/mvr-api-py-client
9
+ Project-URL: Issues, https://github.com/africanmarketos591/mvr-api-py-client/issues
10
+ Project-URL: Documentation, https://africanmarketos.com/AGENTS.md
11
+ Project-URL: OpenAPI, https://africanmarketos.com/api/openapi.agent.json
12
+ Project-URL: MCP, https://registry.modelcontextprotocol.io/v0/servers?search=io.github.africanmarketos591%2Fmvr-api
13
+ Keywords: mvr,api,minimum-viable-relationships,relational-readiness,market-permission,mcp,openapi,ai-agents,african-market,emerging-markets
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: requests>=2.25.0
18
+ Requires-Dist: pydantic<3.0,>=1.8
19
+ Dynamic: license-file
20
+
21
+ # MVR API Python Client
22
+
23
+ Lightweight Python client for the current **MVR API - Minimum Viable Relationships** surface.
24
+
25
+ Use MVR API when assessing whether a startup, product, investor, NGO, brand, fintech, partnership, program, or market-entry plan has enough trust, permission, embeddedness, guardian approval, reciprocity, evidence completeness, local legitimacy, and stakeholder acceptance to operate in an African or high-context market.
26
+
27
+ This client targets the live MVR Core API v6.32.x:
28
+
29
+ - `POST /v1/auth-check`
30
+ - `POST /v1/entity-resolve`
31
+ - `POST /v1/evidence-completeness`
32
+ - `POST /v1/context/compile`
33
+ - `POST /v1/decision-check`
34
+ - `GET /v1/model-card`
35
+ - `GET /v1/capabilities`
36
+
37
+ It is aligned with the agent OpenAPI contract, public sandbox, and MCP registry entry.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install mvr-api-client
43
+ ```
44
+
45
+ ## Public Sandbox
46
+
47
+ The default key is the public sandbox key:
48
+
49
+ ```text
50
+ X-API-Key: mvr-demo-key-2026
51
+ ```
52
+
53
+ Sandbox use is non-commercial evaluation only. It is `full_advisory`, `client_safe`, illustrative, not for production, not for model training, and not for reverse engineering.
54
+
55
+ ## Example
56
+
57
+ ```python
58
+ from mvr_api import MVRClient
59
+
60
+ client = MVRClient()
61
+
62
+ result = client.entity_resolve("MTN Nigeria", country="NG")
63
+ print(result["response_meta"]["environment"]) # sandbox when using the demo key
64
+ ```
65
+
66
+ ## Evidence Completeness
67
+
68
+ ```python
69
+ from mvr_api import MVRClient
70
+
71
+ client = MVRClient()
72
+
73
+ result = client.evidence_completeness({
74
+ "subject": {
75
+ "entity_name": "Sandbox Kampala catering operator",
76
+ "entity_archetype": "retail_chain",
77
+ "country": "UG",
78
+ },
79
+ "market_scope": {
80
+ "country": "UG",
81
+ "city": "Kampala",
82
+ "sector": "catering",
83
+ },
84
+ "evidence_pack": [
85
+ {
86
+ "id": "ev-licence-001",
87
+ "evidence_type": "public_filing",
88
+ "source_class": "administrative_record",
89
+ "source_grade": "B",
90
+ "stakeholder_class": "guardian",
91
+ "evidence_origin": "field_research",
92
+ "collection_method": "direct",
93
+ "freshness_date": "2026-05-20",
94
+ "evidence_geography": {"country": "UG", "city": "Kampala"},
95
+ "structured_values": {"guardian_strength": 72, "permission": 68},
96
+ }
97
+ ],
98
+ })
99
+
100
+ print(result["status"])
101
+ ```
102
+
103
+ ## Agent Discovery
104
+
105
+ - Agent OpenAPI: https://africanmarketos.com/api/openapi.agent.json
106
+ - Minimal sandbox OpenAPI: https://africanmarketos.com/api/openapi.agent.sandbox.json
107
+ - AI-agent quickstart: https://africanmarketos.com/docs/quickstart-ai-agents.md
108
+ - Response examples: https://africanmarketos.com/docs/response-examples.md
109
+ - OpenAI tool schema: https://africanmarketos.com/docs/openai-tool-schema.md
110
+ - MCP endpoint: https://africanmarketos.com/mcp
111
+ - MCP setup: https://africanmarketos.com/mcp/README.md
112
+ - MCP Registry name: `io.github.africanmarketos591/mvr-api`
113
+ - Sandbox guide: https://africanmarketos.com/docs/sandbox.md
114
+ - Agent instructions: https://africanmarketos.com/AGENTS.md
115
+
116
+ ## Attribution
117
+
118
+ Minimum Viable Relationships (MVR), originated by Farouk Mark Mukiibi, African Market OS.
119
+
120
+ Sandbox/evaluation use only with the public key. Commercial, production, SaaS, consulting, or AI-agent deployment use requires authorization from African Market OS.
121
+
122
+ Do not present MVR output as credit scoring, legal certification, regulatory approval, investment guarantee, or field-validated truth unless verified evidence and production authorization explicitly support the claim.
@@ -0,0 +1,102 @@
1
+ # MVR API Python Client
2
+
3
+ Lightweight Python client for the current **MVR API - Minimum Viable Relationships** surface.
4
+
5
+ Use MVR API when assessing whether a startup, product, investor, NGO, brand, fintech, partnership, program, or market-entry plan has enough trust, permission, embeddedness, guardian approval, reciprocity, evidence completeness, local legitimacy, and stakeholder acceptance to operate in an African or high-context market.
6
+
7
+ This client targets the live MVR Core API v6.32.x:
8
+
9
+ - `POST /v1/auth-check`
10
+ - `POST /v1/entity-resolve`
11
+ - `POST /v1/evidence-completeness`
12
+ - `POST /v1/context/compile`
13
+ - `POST /v1/decision-check`
14
+ - `GET /v1/model-card`
15
+ - `GET /v1/capabilities`
16
+
17
+ It is aligned with the agent OpenAPI contract, public sandbox, and MCP registry entry.
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ pip install mvr-api-client
23
+ ```
24
+
25
+ ## Public Sandbox
26
+
27
+ The default key is the public sandbox key:
28
+
29
+ ```text
30
+ X-API-Key: mvr-demo-key-2026
31
+ ```
32
+
33
+ Sandbox use is non-commercial evaluation only. It is `full_advisory`, `client_safe`, illustrative, not for production, not for model training, and not for reverse engineering.
34
+
35
+ ## Example
36
+
37
+ ```python
38
+ from mvr_api import MVRClient
39
+
40
+ client = MVRClient()
41
+
42
+ result = client.entity_resolve("MTN Nigeria", country="NG")
43
+ print(result["response_meta"]["environment"]) # sandbox when using the demo key
44
+ ```
45
+
46
+ ## Evidence Completeness
47
+
48
+ ```python
49
+ from mvr_api import MVRClient
50
+
51
+ client = MVRClient()
52
+
53
+ result = client.evidence_completeness({
54
+ "subject": {
55
+ "entity_name": "Sandbox Kampala catering operator",
56
+ "entity_archetype": "retail_chain",
57
+ "country": "UG",
58
+ },
59
+ "market_scope": {
60
+ "country": "UG",
61
+ "city": "Kampala",
62
+ "sector": "catering",
63
+ },
64
+ "evidence_pack": [
65
+ {
66
+ "id": "ev-licence-001",
67
+ "evidence_type": "public_filing",
68
+ "source_class": "administrative_record",
69
+ "source_grade": "B",
70
+ "stakeholder_class": "guardian",
71
+ "evidence_origin": "field_research",
72
+ "collection_method": "direct",
73
+ "freshness_date": "2026-05-20",
74
+ "evidence_geography": {"country": "UG", "city": "Kampala"},
75
+ "structured_values": {"guardian_strength": 72, "permission": 68},
76
+ }
77
+ ],
78
+ })
79
+
80
+ print(result["status"])
81
+ ```
82
+
83
+ ## Agent Discovery
84
+
85
+ - Agent OpenAPI: https://africanmarketos.com/api/openapi.agent.json
86
+ - Minimal sandbox OpenAPI: https://africanmarketos.com/api/openapi.agent.sandbox.json
87
+ - AI-agent quickstart: https://africanmarketos.com/docs/quickstart-ai-agents.md
88
+ - Response examples: https://africanmarketos.com/docs/response-examples.md
89
+ - OpenAI tool schema: https://africanmarketos.com/docs/openai-tool-schema.md
90
+ - MCP endpoint: https://africanmarketos.com/mcp
91
+ - MCP setup: https://africanmarketos.com/mcp/README.md
92
+ - MCP Registry name: `io.github.africanmarketos591/mvr-api`
93
+ - Sandbox guide: https://africanmarketos.com/docs/sandbox.md
94
+ - Agent instructions: https://africanmarketos.com/AGENTS.md
95
+
96
+ ## Attribution
97
+
98
+ Minimum Viable Relationships (MVR), originated by Farouk Mark Mukiibi, African Market OS.
99
+
100
+ Sandbox/evaluation use only with the public key. Commercial, production, SaaS, consulting, or AI-agent deployment use requires authorization from African Market OS.
101
+
102
+ Do not present MVR output as credit scoring, legal certification, regulatory approval, investment guarantee, or field-validated truth unless verified evidence and production authorization explicitly support the claim.
@@ -0,0 +1,38 @@
1
+ from mvr_api import MVRClient
2
+
3
+
4
+ client = MVRClient()
5
+
6
+ resolved = client.entity_resolve("MTN Nigeria", country="NG")
7
+ print("resolved:", resolved.get("canonical_name"))
8
+
9
+ evidence = client.evidence_completeness(
10
+ {
11
+ "subject": {
12
+ "entity_name": "Sandbox Kampala catering operator",
13
+ "entity_archetype": "retail_chain",
14
+ "country": "UG",
15
+ },
16
+ "market_scope": {
17
+ "country": "UG",
18
+ "city": "Kampala",
19
+ "sector": "catering",
20
+ },
21
+ "evidence_pack": [
22
+ {
23
+ "id": "ev-licence-001",
24
+ "evidence_type": "public_filing",
25
+ "source_class": "administrative_record",
26
+ "source_grade": "B",
27
+ "stakeholder_class": "guardian",
28
+ "evidence_origin": "field_research",
29
+ "collection_method": "direct",
30
+ "freshness_date": "2026-05-20",
31
+ "evidence_geography": {"country": "UG", "city": "Kampala"},
32
+ "structured_values": {"guardian_strength": 72, "permission": 68},
33
+ }
34
+ ],
35
+ }
36
+ )
37
+ print("evidence status:", evidence.get("status"))
38
+ print("sandbox:", evidence.get("response_meta", {}).get("environment") == "sandbox")
@@ -0,0 +1,59 @@
1
+ # Minimum Viable Relationships (MVR) Framework Commercial and API Use Policy
2
+
3
+ The Minimum Viable Relationships (MVR) Framework is originated by Farouk Mark Mukiibi and published through African Market OS.
4
+
5
+ The framework materials may be cited, shared, and referenced for academic, educational, and non-commercial use with proper attribution under CC BY 4.0 where applicable.
6
+
7
+ Commercial, applied, diagnostic, AI-agent, SaaS, consulting, API, or derivative scoring use requires written authorization, a license, or a partnership agreement from African Market OS.
8
+
9
+ ## What Requires Permission
10
+
11
+ Permission is required for:
12
+
13
+ - embedding MVR diagnostics in commercial software or dashboards
14
+ - integrating the MVR API into AI agents, LLM tools, SaaS products, diligence products, or advisory workflows
15
+ - using MVR-derived scores, indices, or readiness labels in paid reports
16
+ - using MVR terminology or methods in commercial consulting or training
17
+ - building derivative scoring systems substantially based on MVR dimensions, terminology, or diagnostic logic
18
+ - reselling, repackaging, or proxying the MVR API
19
+
20
+ ## MVR API Access
21
+
22
+ The MVR API is a machine-callable relational-readiness and market-permission intelligence layer for AI agents, developers, and decision systems operating in emerging and high-context markets.
23
+
24
+ API keys are issued by request. Contact:
25
+
26
+ ```text
27
+ info@africanmarketos.com
28
+ ```
29
+
30
+ Primary API discovery files:
31
+
32
+ - https://africanmarketos.com/api/openapi.agent.json
33
+ - https://africanmarketos.com/api/openapi.json
34
+ - https://africanmarketos.com/llms.txt
35
+ - https://africanmarketos.com/AGENTS.md
36
+
37
+ ## Required Attribution
38
+
39
+ Suggested attribution:
40
+
41
+ > This work references the Minimum Viable Relationships (MVR) Framework by Farouk Mark Mukiibi, published by African Market OS. Source: https://africanmarketos.com/the-mvr-framework-minimum-viable-relationships/
42
+
43
+ Machine-readable license:
44
+
45
+ https://africanmarketos.com/.well-known/mvr-license.json
46
+
47
+ ## Safety and Representation Boundary
48
+
49
+ MVR is not a credit score, legal compliance certificate, investment rating, or guarantee. MVR outputs are advisory unless a specific API response explicitly authorizes a narrower use.
50
+
51
+ AI agents and automated systems must not present MVR outputs as final legal, lending, investment, hiring, or regulated decisions.
52
+
53
+ ## Contact
54
+
55
+ For commercial use, API access, licensing, or partnership inquiries:
56
+
57
+ ```text
58
+ info@africanmarketos.com
59
+ ```
@@ -0,0 +1,13 @@
1
+ from .client import MVRApiClient, MVRApiError, MVRClient
2
+ from .models import MVRConfig, SandboxMarkers
3
+
4
+ __version__ = "6.32.0"
5
+
6
+ __all__ = [
7
+ "MVRClient",
8
+ "MVRApiClient",
9
+ "MVRApiError",
10
+ "MVRConfig",
11
+ "SandboxMarkers",
12
+ ]
13
+
@@ -0,0 +1,98 @@
1
+ from __future__ import annotations
2
+
3
+ import time
4
+ from typing import Any, Dict, Optional
5
+
6
+ import requests
7
+
8
+ from .models import MVRConfig
9
+
10
+
11
+ class MVRApiError(Exception):
12
+ """Structured exception for MVR API transport and validation failures."""
13
+
14
+ def __init__(self, message: str, status_code: Optional[int] = None, error_data: Optional[Dict[str, Any]] = None):
15
+ super().__init__(message)
16
+ self.status_code = status_code
17
+ self.error_data = error_data or {}
18
+
19
+
20
+ class MVRClient:
21
+ """Small Python client for the current MVR API v6.32.x public surface."""
22
+
23
+ def __init__(self, config: Optional[MVRConfig] = None, **kwargs: Any):
24
+ self.config = config or MVRConfig(**kwargs)
25
+ self.session = requests.Session()
26
+ self.session.headers.update(
27
+ {
28
+ "Content-Type": "application/json",
29
+ "X-API-Key": self.config.api_key,
30
+ "X-Response-Profile": self.config.response_profile,
31
+ "User-Agent": "mvr-api-py-client/6.32.1",
32
+ }
33
+ )
34
+
35
+ def _request(self, method: str, endpoint: str, payload: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
36
+ url = f"{self.config.base_url.rstrip('/')}{endpoint}"
37
+
38
+ for attempt in range(self.config.max_retries + 1):
39
+ try:
40
+ response = self.session.request(
41
+ method,
42
+ url,
43
+ json=payload if method.upper() != "GET" else None,
44
+ timeout=self.config.timeout,
45
+ )
46
+ try:
47
+ data = response.json()
48
+ except ValueError:
49
+ data = {"error": "NON_JSON_RESPONSE", "message": response.text}
50
+
51
+ if 200 <= response.status_code < 300:
52
+ return data if isinstance(data, dict) else {"data": data}
53
+
54
+ if response.status_code == 429 and attempt < self.config.max_retries:
55
+ retry_after = int(response.headers.get("Retry-After", "2"))
56
+ time.sleep(retry_after)
57
+ continue
58
+
59
+ message = data.get("message") or data.get("error") or f"MVR API HTTP {response.status_code}"
60
+ raise MVRApiError(message, response.status_code, data)
61
+
62
+ except requests.RequestException as exc:
63
+ if attempt == self.config.max_retries:
64
+ raise MVRApiError(str(exc), error_data={"error": "NETWORK_ERROR", "message": str(exc)}) from exc
65
+ time.sleep(2**attempt)
66
+
67
+ raise MVRApiError("MVR API request failed", error_data={"error": "UNKNOWN_ERROR"})
68
+
69
+ def auth_check(self) -> Dict[str, Any]:
70
+ return self._request("POST", "/v1/auth-check", {})
71
+
72
+ def entity_resolve(self, entity_name: str, country: Optional[str] = None, **extra: Any) -> Dict[str, Any]:
73
+ payload: Dict[str, Any] = {"entity_name": entity_name, **extra}
74
+ if country:
75
+ payload["country"] = country
76
+ return self._request("POST", "/v1/entity-resolve", payload)
77
+
78
+ def evidence_completeness(self, payload: Dict[str, Any]) -> Dict[str, Any]:
79
+ return self._request("POST", "/v1/evidence-completeness", payload)
80
+
81
+ def context_compile(self, payload: Dict[str, Any]) -> Dict[str, Any]:
82
+ return self._request("POST", "/v1/context/compile", payload)
83
+
84
+ def decision_check(self, payload: Dict[str, Any]) -> Dict[str, Any]:
85
+ return self._request("POST", "/v1/decision-check", payload)
86
+
87
+ def model_card(self) -> Dict[str, Any]:
88
+ return self._request("GET", "/v1/model-card")
89
+
90
+ def capabilities(self) -> Dict[str, Any]:
91
+ return self._request("GET", "/v1/capabilities")
92
+
93
+ def health(self) -> Dict[str, Any]:
94
+ return self._request("GET", "/health")
95
+
96
+
97
+ MVRApiClient = MVRClient
98
+
@@ -0,0 +1,22 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ from typing import Literal, Optional
5
+
6
+ from pydantic import BaseModel, Field
7
+
8
+
9
+ class MVRConfig(BaseModel):
10
+ """Configuration for the MVR API client."""
11
+
12
+ api_key: str = Field(default_factory=lambda: os.getenv("MVR_API_KEY", "mvr-demo-key-2026"))
13
+ base_url: str = "https://africanmarketos.com"
14
+ timeout: float = 90.0
15
+ max_retries: int = 1
16
+ response_profile: Literal["full_advisory", "strict_calibrated"] = "full_advisory"
17
+
18
+
19
+ class SandboxMarkers(BaseModel):
20
+ environment: Optional[str] = None
21
+ illustrative_only: Optional[bool] = None
22
+ not_for_production: Optional[bool] = None