Metadata-Version: 2.4
Name: ucp-py
Version: 0.1.0
Summary: Universal Commerce Protocol (UCP) Utilities
Requires-Python: >=3.10
Requires-Dist: grpcio-tools>=1.62.0
Requires-Dist: protobuf>=4.25.0
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# Universal Commerce Protocol

This is a python SDK for Universal Commerce Protocol, an open-source protocol for agentic commerce. 
It is a specification for how agents can communicate with each other to perform commerce-related tasks.

## Protocol Validator & CLI Tool

UCP includes a validation utility to check UCP data structures (`Profile`, `CompleteCheckoutRequest`, `CompleteCheckoutResponse`) syntactically and semantically.

### Programmatic Usage

You can use the validator in your Python code:

```python
from ucp import UcpValidator

# Validate a Profile dictionary
result = UcpValidator.validate_profile(profile_data)
if result.is_valid:
    print("Valid Profile!")
else:
    for error in result.errors:
        print(f"Error at {error.path}: {error.message}")
```

### CLI Usage

A command-line tool is available to check and validate UCP profiles hosted at standard well-known URLs or local files.

First, ensure you have the required dependencies installed:
```bash
pip install grpcio-tools protobuf requests
```

Then run the tool:
```bash
# Validate a remote domain (fetches from https://<domain>/.well-known/ucp)
python3 -m ucp.cli example.com

# Validate a specific URL
python3 -m ucp.cli https://example.com/custom/path/ucp.json

# Validate a local profile file
python3 -m ucp.cli -f path/to/profile.json

# Bypass SSL verification (useful for self-signed local certs)
python3 -m ucp.cli -k localhost:8000
```

# Roadmap 
- Add Protobuffs for representing UCP data objects. 
- Generation of sample agent discovery files.
- Sample application. 
- Tests 

# Make suggestions 

Please send pull requests proposing features. 
