Skip to main content

Protocol Pact: Universal Markdown for Shell/MCP/REST/WS

Project description

Propact 🚀 Protocol Pact via Markdown

PyPI Python License

Markdown speaks all protocols! Shell → MCP → REST/WS without conversion.

pip install propact
propact README.md  # Run this file!

🚀 Quick Start

echo "Shell → MCP → REST pipeline works!"

Features

  • Universal Protocol Support: Execute Shell, MCP, REST, and WebSocket protocols directly from Markdown
  • Attachment Handling: Manage binary files and images within your protocol documents
  • Async Execution: Full async/await support for concurrent protocol execution
  • Type Safety: Full type annotations with Pydantic integration
  • Modern Python: Built with Python 3.10+ and the latest best practices

Example Usage

import asyncio
from propact import ToonPact

async def main():
    # Load a Protocol Pact document
    pact = ToonPact("README.md")
    
    # Execute all protocols
    results = await pact.execute()
    print(results)
    
    # Execute only shell protocols
    shell_results = await pact.execute(protocol=ProtocolType.SHELL)
    print(shell_results)

asyncio.run(main())

Protocol Blocks

Shell Protocol

echo "Hello from shell!"
ls -la

MCP Protocol

{
  "method": "tools/call",
  "params": {
    "name": "example_tool",
    "arguments": {"input": "test"}
  }
}

REST Protocol

GET https://api.example.com/data
Content-Type: application/json

WebSocket Protocol

{
  "type": "subscribe",
  "channel": "updates"
}

Installation

pip install propact

Or with Poetry:

poetry add propact

Development

# Clone the repository
git clone https://github.com/wronai/propact.git
cd propact

# Install development dependencies
poetry install --with dev

# Run tests
make test

# Run linting
make lint

License

Licensed under Apache-2.0.

Licensed under Apache-2.0.

Apache-2.0 © Tom Sapletta

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

propact-0.0.3.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

propact-0.0.3-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file propact-0.0.3.tar.gz.

File metadata

  • Download URL: propact-0.0.3.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for propact-0.0.3.tar.gz
Algorithm Hash digest
SHA256 bfb5ccce2c00cb97d7351457335df3d06b64cd1c2ffebe7167b048b0d2ad111d
MD5 73d36f896bb11399693ec53ffa9187ae
BLAKE2b-256 e95c4ee120aca003910670b8e5e680fb751d41851aa33b3f2b76b52198a0fca7

See more details on using hashes here.

File details

Details for the file propact-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: propact-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for propact-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 682b6f2c32d50005d9249781b1368bb48914c3d06b244bde1dcb574fd70fb2a8
MD5 764e947945fadcb3899c9bc8a5e14726
BLAKE2b-256 e77d8a10aac291e699489c5f7c99c9486ee4011a38897f283c8fd56e23678613

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