Skip to main content

mezi

The mezi API client and webhook verifier for Python 3.9 or newer. Standard library only.

mezi holds a buyer's payment until they approve the work, then releases it. The API reads your account, deals and events. Nothing in it moves money.

pip install mezi

Keep the key in MEZI_API_KEY, on a server.

Read your deals

from mezi import MeziClient

mezi = MeziClient()  # reads MEZI_API_KEY
for deal in mezi.all_deals(role="owner"):
    print(deal["id"], deal["state"], deal["amountCents"])

Follow events as they happen

from mezi import MeziClient

mezi = MeziClient()
for event in mezi.stream_events(types=["deal.funded", "payout.released"]):
    print(event["id"], event["type"], event["data"]["id"])  # dedupe on event["id"]

Where a proxy cuts long connections, mezi.watch_events() does the same job by polling. Both take cursor and on_cursor so a restart resumes where it stopped.

Check a webhook

import os
from flask import Flask, request
from mezi import verify_webhook, WebhookVerificationError

app = Flask(__name__)

@app.post("/mezi/webhooks")
def mezi_webhook():
    try:
        event = verify_webhook(
            request.get_data(), request.headers.get("Mezi-Signature"), os.environ["MEZI_WEBHOOK_SECRET"]
        )
    except WebhookVerificationError:
        return "", 400
    print(event["type"], event["data"]["id"])
    return "", 204

Errors from the API raise MeziApiError; branch on err.code (for example DEAL_NOT_FOUND).

Full guide: https://developer.mezi.app/guides/client

Metadata

Release files for mezi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mezi 0.1.0
File Size Uploaded Provenance Actions
mezi-0.1.0.tar.gz 9.3 kB Without provenance Details for mezi-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mezi 0.1.0
File Interpreter ABI Platform Actions
mezi-0.1.0-py3-none-any.whl Python 3 none any Details for mezi-0.1.0-py3-none-any.whl

Total release size: 19.2 kB

Release files / mezi-0.1.0.tar.gz

Download URL mezi-0.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5e3bae592269549a2658e71efa8f2adef546e30ae0578c979f7339ea4de921e0
BLAKE2b-256 checksum
How to use checksums
13f957da8bc56316a3ec58cb5a57b244a9429682f9807aaa6a4dc775a8fbe18c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / mezi-0.1.0-py3-none-any.whl

Download URL mezi-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d350667eecb861610c04a092c1e8ba44463121ca9aec7f0d36efc9c46f5c6bda
BLAKE2b-256 checksum
How to use checksums
fbabd4d8c6de1cbdfec4b164745f89b961af553fa1f1913938ffd84b65cb34e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.3

Security for mezi 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page