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.1

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.1
File Size Uploaded Provenance Actions
mezi-0.1.1.tar.gz 9.3 kB Without provenance Details for mezi-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 19.3 kB

Release files / mezi-0.1.1.tar.gz

Download URL mezi-0.1.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8ad4c1112ce1b980c07379dadda88e986cd9ec7e23e053d0e67e500fc6df6e3e
BLAKE2b-256 checksum
How to use checksums
84f2dd837067f32f7f2f2f6b0f6400f9ccf14cf49e0b765e3bbcf44991a45e28
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.1-py3-none-any.whl

Download URL mezi-0.1.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0940d0e37f034cd3ea9421c371ad0b5247b5f95c25543ef40678591a88f527c
BLAKE2b-256 checksum
How to use checksums
bb0153534a41daeea06d8c572acb99982d630ce65a4a00265336dc18c52eb387
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.1

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.1 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