Skip to main content

Python client for African Market OS — Minimum Viable Relationships (MVR) API

Project description

African Market OS — MVR API Python Client

Official Python SDK for the
Minimum Viable Relationships (MVR) API — v2.6.0-enterprise

This client provides full access to all MVR API endpoints:

✔ Scores

✔ Survey aggregation

✔ Trends

✔ Forecasts

✔ Benchmarking

✔ Insights

✔ Policy multi-audit

✔ Stories

✔ Metadata + Usage

✔ Health checks

✔ Session token authentication


📦 Installation

You can install directly from PyPI (recommended):

pip install mvr-api-client

Or install from source:

pip install .

🚀 Quickstart Example

from mvr_api import MVRApiClient, MVRApiConfig

# Create configuration
config = MVRApiConfig(
    license="your-license-key",
    email="you@example.com"
)

# Initialize client
client = MVRApiClient(config)

# Call API
scores = client.get_scores("fintech")
print("MVR Index:", scores.mvr_index)

🧪 Submitting Survey Data

from mvr_api import SurveyAggregateRequest, StakeholderResponse

survey_request = SurveyAggregateRequest(
    stakeholder_responses=[
        StakeholderResponse(
            dimension="Embeddedness",
            scale=4,
            reasons=["Strong community integration"]
        )
    ],
    sector="fintech"
)

result = client.survey_aggregate(survey_request)
print(result.mvr_index)

📈 Trends Example
trends = client.get_trends(sector="fmcg", days=30)
print("Average Index:", trends.average_index)
print("Slope:", trends.slope)

🔮 Forecast Example
from mvr_api import ForecastRequest

forecast = client.forecast(ForecastRequest(
    current_index=0.65,
    velocity=0.02,
    horizon=30
))

print("Projected MVR:", forecast.projected_index)

👥 Entity Comparison
from mvr_api import CompareRequest

comparison = client.compare(CompareRequest(
    a_index=0.72,
    b_index=0.58
))

print("Delta:", comparison.delta)
print("Verdict:", comparison.verdict)

📊 Benchmarks
bench = client.get_benchmark("fintech")
print(bench.benchmark) Temperature
temp = client.get_temperature()
print(temp.continent_score)

📘 Metadata
meta = client.get_meta()
print(meta.model)

🔐 Session-Based Authentication
# Create session token
session = client.create_session("license-key", "you@example.com")

# Build session-authenticated client
session_client = client.with_session(session.session_token)

scores = session_client.get_scores()
print(scores.mvr_index)

🛡 Error Handling

All API errors raise a structured MVRApiError:

from mvr_api import MVRApiError

try:
    client.get_scores()
except MVRApiError as e:
    print("Error:", e.error_data.error_code)
    print("Message:", e.error_data.message)

📂 Project Structure
mvr-api-py-client/
│
├── setup.py
├── README.md
└── mvr_api/
    ├── __init__.py
    ├── client.py
    └── models.py

📄 License

This SDK is released under the MIT License.

🧬 Attribution
MVR Framework  African Market OS
Creator: Farouk Mark Mukiibi
Framework DOI: 10.5281/zenodo.17310446

🌍 About

The Minimum Viable Relationships (MVR) Framework measures:

Trust

Belonging

Permission

Embeddedness

…to evaluate relational readiness for ventures entering
high-context markets across Africa.

Learn more:https://africanmarketos.com/the-mvr-framework-minimum-viable-relationships/

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

mvr_api_client-2.6.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

mvr_api_client-2.6.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file mvr_api_client-2.6.0.tar.gz.

File metadata

  • Download URL: mvr_api_client-2.6.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for mvr_api_client-2.6.0.tar.gz
Algorithm Hash digest
SHA256 cf2be66cc4905e0eb3de12f5758661bdc4ceefbdbcfa2dba77fdbc4363875936
MD5 90fe403e0e85543e67316bd868282a00
BLAKE2b-256 374dd523faefa1662c2368064eeff1cc5d7e2f5f6aed7de883426cb97a00554c

See more details on using hashes here.

File details

Details for the file mvr_api_client-2.6.0-py3-none-any.whl.

File metadata

  • Download URL: mvr_api_client-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for mvr_api_client-2.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9875e0a6a3dec5f13ec540fa9b244dd8593dab0034a3e36add31a93720b83de6
MD5 6ce47c4306652052db2dd560eca9d057
BLAKE2b-256 10e8d1042d6c185002bd7f7b01c0206a95b8c18827d8ba1c9f0a226aff39e4f3

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