Skip to main content

SDK for integrating with the Monapi Marketplace

Project description

Monapi SDK for Python

This SDK allows providers to easily integrate with the Monapi Marketplace.

Installation

pip install monapi-sdk

Usage

from fastapi import FastAPI, Request
from monapi import MarketplaceProvider
import os

app = FastAPI()

# Initialize the marketplace provider with your secret key
marketplace = MarketplaceProvider(
    provider_secret=os.getenv("MARKETPLACE_SECRET"),
)

# Add the marketplace middleware to validate incoming requests
@app.middleware("http")
async def marketplace_middleware(request: Request, call_next):
    return await marketplace.validate_request_middleware(request, call_next)

# Create your API endpoints
@app.post("/api/webhook")
async def handle_webhook(request: Request):
    # The request has already been validated by the middleware
    # You can now process the webhook
    data = await request.json()
    return {"status": "success", "data": data}

Features

  • Request validation using HMAC-SHA256 signatures
  • FastAPI middleware for easy integration
  • Automatic timestamp validation
  • Detailed logging for debugging

Requirements

  • Python 3.7+
  • FastAPI

License

MIT

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

monapi_sdk-0.1.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

monapi_sdk-0.1.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file monapi_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: monapi_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for monapi_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1c3a14f4e1ccd0f2b9a598369e0b0cc400425388088f55ab83041467b333225f
MD5 e5ade17990ab0f61a17b98c01c45e595
BLAKE2b-256 b45e405127e3cdec9a1b180c03641d2904984f93027f399bb8ee19b8009424c5

See more details on using hashes here.

File details

Details for the file monapi_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: monapi_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for monapi_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7ac36e56cf37d2baac8b20d4acb4c14cfa9b5f9a6b724b082b43faa0fa187554
MD5 6dc3352d3f6dbd87a233427b298b54cf
BLAKE2b-256 9959c42ee2608228345cbede11e8da7cc1c20f89f17c4ea7e8cd9c860cdfc5f4

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