Metadata-Version: 2.4
Name: eep-discovery
Version: 0.1.0
Summary: EEP discovery utilities — manifest validation, Link header parsing, DNS TXT record parsing
License-Expression: Apache-2.0
Project-URL: Homepage, https://eep.dev
Project-URL: Source, https://github.com/eep-dev/EEP
Project-URL: Issues, https://github.com/eep-dev/EEP/issues
Project-URL: Documentation, https://github.com/eep-dev/EEP#readme
Project-URL: Changelog, https://github.com/eep-dev/EEP/blob/main/CHANGELOG.md
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# eep-discovery — Python

> **EEP discovery utilities — Python port of [@eep-dev/discovery](../@eep-dev/discovery).**

[![EEP](https://img.shields.io/badge/EEP-v0.1-blue)](../../docs/current/SPECIFICATION.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-green)](../../LICENSE)

## Overview

Python implementation of the three EEP discovery mechanisms (Whitepaper §4):

| Function | Description |
|----------|-------------|
| `validate_manifest()` | Validate `/.well-known/eep.json` manifests |
| `parse_link_header()` | Parse HTTP `Link: <url>; rel="eep"` headers |
| `parse_dns_txt_record()` | Parse `_eep.domain TXT "v=eep1; manifest=..."` records |

## Installation

```bash
pip install -e packages/eep-discovery-python
```

## Usage

```python
from eep_discovery import validate_manifest, parse_link_header, parse_dns_txt_record

# Validate manifest
result = validate_manifest({
    "did": "did:web:example.com",
    "eep_version": "0.1",
    "layers": {"layer1": "https://api.example.com/eep"},
    "supported_content_types": ["application/json"],
    "pqc_ready": False,
    "x402_enabled": True,
})
assert result.valid

# Parse Link header
links = parse_link_header('<https://example.com/eep.json>; rel="eep"')
# [EEPLinkInfo(url='https://...', rel='eep')]

# Parse DNS TXT record
dns = parse_dns_txt_record("v=eep1; manifest=https://example.com/.well-known/eep.json")
assert dns.manifest_url == "https://example.com/.well-known/eep.json"
```

## Tests

```bash
python3 -m pytest tests/ -v
```

Comprehensive tests cover manifest validation, Link header parsing, and DNS TXT parsing.

## License

Apache-2.0
