Metadata-Version: 2.4
Name: masonry-sdk
Version: 0.1.0
Summary: The Masonry SDK — e-signatures, document processing, workflow automation, and more
Project-URL: Homepage, https://themasonry.com
Project-URL: Repository, https://github.com/The-Masonry/sdk
Project-URL: Issues, https://github.com/The-Masonry/sdk/issues
Author-email: The Masonry <eng@themasonry.com>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: authlib>=1.3.0
Requires-Dist: click<9,>=8.0
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2.0
Provides-Extra: dev
Requires-Dist: mcp<2,>=1.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.22; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp<2,>=1.0; extra == 'mcp'
Description-Content-Type: text/markdown

# masonry-sdk

The official Python SDK for [The Masonry](https://themasonry.com) — e-signatures, document processing, workflow automation, and more in a single package.

## Install

```bash
pip install masonry-sdk
```

## Configuration

```bash
export MASONRY_API_KEY="msk_..."

# Or per-service:
export MASONRY_SIGN_URL="https://sign.themasonry.com"
export MASONRY_SIGN_API_KEY="msk_..."
export MASONRY_DOCUMENT_URL="https://document.themasonry.com"
export MASONRY_DOCUMENT_API_KEY="mdk_..."
```

## SDK Usage

```python
from masonry import sign, document, auth

# E-signatures
client = sign.MasonrySignClient()
session = client.create_session(signer_name="Jane Doe")
print(f"Sign here: {session.signing_url}")

# Document parsing
client = document.MasonryDocumentClient()
result = client.parse("contract.pdf")
print(f"Found {len(result.fields)} fields")

# Document filling
filled = client.fill("w9.pdf", data={"name": "John Doe", "ssn": "123-45-6789"})
with open("filled_w9.pdf", "wb") as f:
    f.write(filled)
```

## CLI

```bash
# Sign
masonry sign create-session --name "Jane Doe"
masonry sign status <session_id>
masonry sign enroll --email jane@example.com

# Document
masonry document parse contract.pdf
masonry document fill w9.pdf -d '{"name": "John Doe"}' -o filled.pdf
```

## MCP Server

One config, all tools:

```json
{
  "mcpServers": {
    "masonry": {
      "command": "masonry",
      "args": ["mcp-server"],
      "env": {
        "MASONRY_SIGN_API_KEY": "msk_...",
        "MASONRY_DOCUMENT_API_KEY": "mdk_..."
      }
    }
  }
}
```

### Tools

| Tool | Primitive | Description |
|------|-----------|-------------|
| `create_signing_session` | Sign | Create an e-signature session |
| `get_session_status` | Sign | Check signing session status |
| `get_signature_image` | Sign | Download signature as PNG |
| `enroll_signer` | Sign | Start biometric enrollment |
| `create_auth_challenge` | Sign | Biometric sign-to-approve |
| `get_challenge_status` | Sign | Check challenge status |
| `parse_document` | Document | Extract fields from PDF/DOCX |
| `fill_document` | Document | Fill a template with data |

## Development

```bash
git clone https://github.com/The-Masonry/sdk
cd sdk
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
```
