Metadata-Version: 2.4
Name: pressprotocol-py
Version: 1.0.7
Summary: Official PressProtocol Python SDK - Sovereign Publishing & Multi-Transport Resolution
Author-email: PressProtocol Architects <hello@pressprotocol.com>
License-Expression: MIT
Project-URL: Homepage, https://pressprotocol.com
Project-URL: Documentation, https://pressprotocol.com/docs
Project-URL: Repository, https://github.com/0xshikhar/AnonPress
Project-URL: Issues, https://github.com/0xshikhar/AnonPress/issues
Keywords: pressprotocol,sovereign,publishing,ipfs,tor,ed25519,multihash
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# PressProtocol Python SDK (`pressprotocol-py`)

[![PyPI version](https://img.shields.io/pypi/v/pressprotocol-py.svg?color=4F46E5&style=flat-square)](https://pypi.org/project/pressprotocol-py/)
[![Python versions](https://img.shields.io/pypi/pyversions/pressprotocol-py.svg?style=flat-square)](https://pypi.org/project/pressprotocol-py/)
[![License: MIT](https://img.shields.io/badge/License-MIT-emerald.svg?style=flat-square)](https://opensource.org/licenses/MIT)

Official Python SDK for [PressProtocol](https://pressprotocol.com) — Autonomous, censorship-resistant publishing infrastructure, zero-custody cryptographic signing, and multi-transport content syndication across IPFS and Tor v3.

---

## Features

- 🔐 **Zero-Custody Client Signing**: Deterministic canonical payload serialization and Ed25519 verification.
- ⚡ **Deterministic In-Memory CIDv1**: Instant RFC 4648 base32 multihash calculation without an IPFS node.
- 🌐 **Multi-Transport Resolution**: Automated discovery across IPFS public gateways and Tor `.onion` endpoints.
- 🛡️ **Zero External Dependency Core**: Relies strictly on Python standard library with optional acceleration.

---

## Installation

```bash
pip install pressprotocol-py
```

Or install with `uv`:

```bash
uv add pressprotocol-py
```

---

## Quickstart

```python
from pressprotocol import PressProtocol

# 1. Initialize client
client = PressProtocol(
    endpoint="https://pressprotocol.com"
)

# 2. Publish article directly to decentralized swarms
post = client.publish_raw(
    title="Data Science Transparency Audit",
    content="# Methodology & Findings\n\nVerifiable cryptographic dataset preserved across swarms.",
    tags=["science", "reproducibility", "whistleblower"]
)

print(f"✅ Published CID: {post['cid']}")
print(f"📦 IPFS Gateway: {post.get('urls', {}).get('ipfs')}")
print(f"🧅 Tor Mirror: {post.get('urls', {}).get('tor')}")
```

---

## In-Memory Deterministic CIDv1

Compute standard base32 CIDv1 multihashes in-memory without contacting any daemon or gateway:

```python
from pressprotocol.crypto import calculate_deterministic_cidv1

cid = calculate_deterministic_cidv1("Hello, Sovereign Cyberspace!")
print("Deterministic CIDv1:", cid) # bafk...
```

---

## Resolving Content

```python
# Resolve multi-transport mirror availability
article = client.resolve("bafkreibm7...")

print(f"Title: {article.get('title')}")
print(f"Tor Gateway: {article.get('torGatewayUrl')}")
```

---

## License

MIT © [0xShikhar](https://github.com/0xShikhar) & [PressProtocol Architects](https://pressprotocol.com)
