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+
pochiCLI: This package is a wrapper around thepochicommand-line tool. You must have thepochiCLI 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
with open("path/to/your/verify_todo.json", "r") as f:
spec = json.load(f)
reason = spec["reason"]
truth = spec["truth"]
try:
result = verifier.verify(
reason=reason,
truth=truth,
use_browser_agent=True,
trajectory_dir="path/to/save/trajectory/files"
)
except (FileNotFoundError, ValueError) as e:
print(f"Configuration error: {e}")
raise
except Exception as e:
print(f"Verification could not be completed: {e}")
raise
if result.status == "pass":
print("Verification successful!")
else:
print("Verification failed.")
print(f"Status: {result.status}")
print(f"Reason: {result.reason}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pochi_verifier-0.2.3.tar.gz.
File metadata
- Download URL: pochi_verifier-0.2.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20f38488fd1e20ee16bc1a32b4efb1be97f328dc5ee7694de8a44894ec1d50fd
|
|
| MD5 |
edcde516bdfeac542748d5d0298b10f0
|
|
| BLAKE2b-256 |
87e31a2abbe62871e4346cef1f759b56ed282088dc62ca296beafb415624c51b
|
File details
Details for the file pochi_verifier-0.2.3-py3-none-any.whl.
File metadata
- Download URL: pochi_verifier-0.2.3-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bbe227595417524fc4ad75b2782e6d67bfc3f302643e61fc6cf35b6d6819613
|
|
| MD5 |
9cb6d0739e6f28fe5752c09eda4d564c
|
|
| BLAKE2b-256 |
132050ff26f5f1ae7e2666aa5b892320aae8d20563c1e207191d38ab10bfb1f2
|