Metadata-Version: 2.5
Name: nomtp
Version: 0.1.1
Summary: Network-Oriented Media Transfer Protocol - High-throughput, resilient transfer protocol
Project-URL: Homepage, https://nomtp.abdullah.dpdns.org
Project-URL: Documentation, https://nomtp.abdullah.dpdns.org
Project-URL: Repository, https://github.com/TypeAbdullah/nomtp
Project-URL: Issues, https://github.com/TypeAbdullah/nomtp/issues
Project-URL: Changelog, https://github.com/TypeAbdullah/nomtp/blob/main/CHANGELOG.md
Author-email: TypeAbdullah <ognapaextra@gmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: asyncio,file-transfer,media-transfer,merkle-tree,network,protocol,resumable,streaming
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Communications :: File Sharing
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Networking
Requires-Python: >=3.12
Requires-Dist: click>=8.1.0
Requires-Dist: cryptography>=42.0.0
Requires-Dist: rich>=13.7.0
Requires-Dist: zstandard>=0.22.0
Provides-Extra: dev
Requires-Dist: mypy>=1.9.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Requires-Dist: types-cryptography; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
Description-Content-Type: text/markdown

# NOMTP — Network-Oriented Media Transfer Protocol

[![Documentation](https://img.shields.io/badge/docs-nomtp.abdullah.dpdns.org-blue.svg)](https://nomtp.abdullah.dpdns.org)
[![Python Version](https://img.shields.io/badge/python-3.12%2B-brightgreen.svg)](https://python.org)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)

**NOMTP** is a modern, high-throughput, resilient application-layer binary protocol specifically engineered for file, media, object, and streaming data transfer over secure TCP+TLS and QUIC transports.

---

## Key Features

- **Binary Wire Protocol**: Fixed 32-byte header with zero JSON overhead, CRC16 header verification, and Big-Endian encoding.
- **Native Resumability**: Sparse transfer maps, chunk bitmaps, and disk journals enabling resume after network loss or server restart.
- **Hierarchical Integrity Trees**: Merkle tree hashing (CRC32C / SHA-256 / BLAKE3) for incremental and whole-file validation.
- **Parallel Chunk Transfer**: Multiplexed concurrent chunk streams over single or pooled connections.
- **Content Addressing & Deduplication**: Cryptographic content digests preventing duplicate payload retransmission.
- **Adaptive Chunking & Compression**: Dynamic chunk sizing with zstd/gzip auto-detection and smart media bypass.
- **Storage Abstraction**: Seamless integration with Local Filesystem, In-Memory, and Object Storage (S3 / R2 / MinIO).
- **Security & Multi-Tenancy**: TLS 1.3, token authentication, permission masks, token-bucket rate limiting, and quotas.

---

## Installation

```bash
pip install nomtp
```

---

## Quick Start

### Start Server

```bash
nomtp server ./storage --port 9000 --token secret123
```

### Upload a File

```bash
nomtp upload video.mp4 --host localhost --port 9000 --token secret123 --parallel 4
```

### Download a File

```bash
nomtp download video.mp4 ./downloaded.mp4 --host localhost --port 9000 --token secret123
```

### Python API

```python
import asyncio
from nomtp import Client

async def main():
    async with Client(host="localhost", port=9000, auth_token="secret123") as client:
        # Upload with automatic chunking and resume support
        result = await client.upload(
            local_path="movie.mkv",
            remote_path="videos/movie.mkv",
            parallel=4,
            resume=True
        )
        print(f"Uploaded {result.bytes_transferred} bytes (Transfer ID: {result.transfer_id})")

        # Download
        await client.download(
            remote_path="videos/movie.mkv",
            local_path="downloaded_movie.mkv",
            parallel=4,
            resume=True
        )

if __name__ == "__main__":
    asyncio.run(main())
```

---

## Documentation

Comprehensive documentation, architecture guides, and protocol specifications are available at:
[https://nomtp.abdullah.dpdns.org](https://nomtp.abdullah.dpdns.org)

---

## License

NOMTP is licensed under the [Apache-2.0 License](LICENSE).
