Tutorial for creating a new enrichment
Supplier look-up in Python
1. Create and configure a simple test project
2. Create a new API endpoint for matching a supplier
import logging
from os import environ as env
# Basic Flask imports and configuration
from flask import Flask, jsonify, request
from flask_httpauth import HTTPTokenAuth
app = Flask(__name__)
auth = HTTPTokenAuth(scheme="Bearer")
# Define your Bearer token
BEARER_TOKEN = env.get("BEARER_TOKEN", "[optionally set bearer token here]")
@auth.verify_token
def verify_token(token):
return bool(token == BEARER_TOKEN)
##### ADD API CALLS HERE LATER
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
# to debug locally, use the following command:
# FLASK_APP=server.py FLASK_ENV=development flask run --port 50013. Configure the Find Supplier enrichment




Upload a document and test



(Optional) Add a second API call to list all suppliers
Add a new route to the Flask server
Configure the options in the enrichment

Test the options

Last updated