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.

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.2.tar.gz (13.2 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.2-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: propact-0.0.2.tar.gz
  • Upload date:
  • Size: 13.2 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.2.tar.gz
Algorithm Hash digest
SHA256 1ec4c5fb308997d3bd5e7a68000f285a1e2898678bcbae2daddb4346b2a4f358
MD5 f2a898dd3cf35089241c7d965ef5eeba
BLAKE2b-256 001b4f9fd4149a00ca650a44eb60c33984d42c29e1bf0be96eb7e14094f16b12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: propact-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a0aa2661e72bbc7f5955eb7dc1c9c5bb0d8489331c09240d1e721fdb5f4838ac
MD5 141627bbd9052b3d279f5ce777e9f8e7
BLAKE2b-256 922fab35e8a74f07bbefbceb4e9f65b132902d2c0b8bd6cd8a933dfb3d85b6d5

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