Skip to main content

ApprovalML

YAML-based approval workflow parser and validator.

Install

pip install approvalml

Or for local development:

git clone https://github.com/yourorg/approvalml
pip install -e ./approvalml

CLI

# Validate a workflow file
approvalml validate my-workflow.yaml

# Validate with step/field details
approvalml validate my-workflow.yaml --verbose

# Print a readable summary
approvalml info my-workflow.yaml

Python API

from approvalml import parse_approvalml_file, parse_approvalml

# From a file
workflow, summary = parse_approvalml_file("leave-request.yaml")
if workflow:
    print(workflow.name)          # "Employee Leave Request"
    print(workflow.workflow.keys()) # step names
else:
    print(summary["errors"])

# From a YAML string
yaml_text = open("my-workflow.yaml").read()
workflow, summary = parse_approvalml(yaml_text)

Example Workflow

name: "Leave Request"
description: "Simple leave approval"

form:
  fields:
    - name: "leave_type"
      type: "select"
      label: "Type of Leave"
      required: true
      options:
        - value: "vacation"
          label: "Vacation"
        - value: "sick"
          label: "Sick Leave"

    - name: "total_days"
      type: "number"
      label: "Total Days"
      required: true

workflow:
  manager_approval:
    name: "manager_approval"
    type: "decision"
    approver: "${requestor.manager}"
    on_approve:
      continue_to: "done"
    on_reject:
      end_workflow: true

  done:
    name: "done"
    type: "end"
    notify_requestor: "Leave request approved"

Example Templates

Browse ready-to-use workflow templates in the examples/ folder:

Category Template
HR Leave Request
HR Pre-screening Interview
Finance Purchase Request
Finance Expense Approval
Finance Invoice Processing
IT Equipment Request
Procurement Vendor Purchase Order
Procurement Purchase Order with Signature

Running Tests

pip install -e ".[dev]"
pytest

License

MIT

Metadata

Release files for approvalml 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 approvalml 0.1.0
File Size Uploaded
approvalml-0.1.0.tar.gz 39.5 kB Details

Built distribution (wheel)

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

Total release size: 70.8 kB

Release files / approvalml-0.1.0.tar.gz

Download URL approvalml-0.1.0.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dcb4789db06547a7592999f181792b6af9e0cb2fd8d204b6154e6b983b5b1ebd
BLAKE2b-256 checksum
How to use checksums
294dcfa086e60b1cf416b2d419a61172d092098f5c42b81e9c1975b7a4631b6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.7

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

Download URL approvalml-0.1.0-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff7d39d78d0dda61a527594aabbc53b8e686c83f95e7dda6de5c0897638881b4
BLAKE2b-256 checksum
How to use checksums
06e476d351c781d852ec3c7b803fde3c3e6e2c9692ff9cb1816657a8bf11f846
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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