Skip to main content

A library that runs the Pochi CLI for verification tasks.

Project description

Pochi Verifier

A Python interface for the pochi CLI to streamline verification processes.

Description

pochi-verifier provides a convenient way to run pochi CLI commands from your Python code. This allows you to integrate pochi's verification capabilities directly into your Python-based testing frameworks.

Requirements

  • Python 3.12+
  • pochi CLI: This package is a wrapper around the pochi command-line tool. You must have the pochi CLI installed.
  • agent-browser: Required for running browser verifications.
  • FFmpeg: Required for recording the browser verification trajectory as a video file.

Usage

pochi-verifier works with a specification that describes the verification task. Here is an example of a browser_verification spec for a to-do list application:

verify_todo.json

{
  "name": "verify_todo_list_functionality",
  "reason": "The application should feature a fully functional to-do list on its homepage. Users must be able to add, edit, and remove items, as well as mark items as complete and incomplete.",
  "truth": "Navigate to http://localhost:8080. Verify that an input field for adding new to-do items is visible. Click the input field, type 'Buy milk', and press Enter. Verify that 'Buy milk' appears in the to-do list. Find the 'Buy milk' item and click the checkbox next to it to mark it as complete. Verify that the 'Buy milk' item is now marked as done (e.g., has a line-through). Find the 'Buy milk' item and click the 'delete' button next to it. Verify that 'Buy milk' is no longer present in the to-do list."
}

You can then use pochi-verifier to run this verification from your Python code. You can also specify a directory to save trajectory files.

import json
from pochi_verifier import PochiVerifier

# Create a verifier instance 
verifier = PochiVerifier()

# Example: Run a verification command
try:
    with open("path/to/your/verify_todo.json", "r") as f:
        spec = json.load(f)
    reason = spec["reason"]
    truth = spec["truth"]
    
    result = verifier.verify(
        reason=reason,
        truth=truth,
        use_browser_agent=True,
        trajectory_dir="path/to/save/trajectory/files"
    )
    print("Verification successful!")
    print(f"Status: {result.status}")
    print(f"Reason: {result.reason}")
except Exception as e:
    print(f"Verification failed: {e}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pochi_verifier-0.1.6.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pochi_verifier-0.1.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pochi_verifier-0.1.6.tar.gz.

File metadata

  • Download URL: pochi_verifier-0.1.6.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pochi_verifier-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ba8778091a685dae5a2f0a273bc44713feaab70305ea4560e69c07eebcac6f1b
MD5 d58d81428f553af37e61709a5cbd5310
BLAKE2b-256 872be7b3d3c6b0e81c1be9a653efccd7c997b3718c3f4aadf250b80aa4ed8715

See more details on using hashes here.

File details

Details for the file pochi_verifier-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pochi_verifier-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pochi_verifier-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7dff29aeff57776ae4a7a9ba0fa74fd8a601dcf2a13d3abba652e3cdb38aa9da
MD5 b3ec0098f7637bf7126d0ffe3335cc04
BLAKE2b-256 b82d7eecb4f955c126f319d0156253a6332b42f14fcca108316e66dfe6b33e6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page