Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python Schema for Monzo API Webhooks. Build real-time finance applications with the Monzo API!

License

Notifications You must be signed in to change notification settings

trickeydan/monzo-webhook-schema

Repository files navigation

Monzo Webhook Schema

Tests LGPL Licence Bees

This is a work in progress project to document the complete schema for the Monzo Webhook API.

It is implemented in Python using the Pydantic data validation library.

How did you make this?

The schema is based on my observations of data from the API. In order to make it complete, contributions from the community are needed. This means that we'll be able to cover a wider variety of transaction types.

Usage

The MonzoWebhookSchema class can be used to validate and access data programatically. A JSON Schema can also be generated from this file.

You can use this to easily create applications that use real-time data from Monzo!

from fastapi import FastAPI
from monzo_webhook import MonzoWebhookSchema

app = FastAPI

@app.route("/mywebhook")
async def webhook(data: MonzoWebhookSchema) -> str:
    if data.amount < 0:
        print(f"Received £{data.amount/100}")
    else:
        print(f"Spent £{data.amount/100} on {data.category}")
    return "Success"

About

Python Schema for Monzo API Webhooks. Build real-time finance applications with the Monzo API!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published