---
title: resolution
sidebarTitle: resolution
---

# `pdsx._internal.resolution`


PDS and URI resolution utilities.

## Functions

### `discover_pds` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/resolution.py#L49" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
discover_pds(repo: str) -> str
```


discover PDS URL from handle or DID.

**Args:**
- `repo`: handle (e.g., 'zzstoatzz.io') or DID (e.g., 'did\:plc\:...')

**Returns:**
- PDS URL (e.g., 'https://pds.zzstoatzz.io')

**Raises:**
- `ValueError`: if handle cannot be resolved or PDS not found


## Classes

### `URIParts` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/resolution.py#L11" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


parsed components of an AT-URI.


**Methods:**

#### `from_uri` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/resolution.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
from_uri(cls, uri: str, client_did: str | None = None) -> URIParts
```

parse an AT-URI into its components.

**Args:**
- `uri`: either full AT-URI (at\://did/collection/rkey) or shorthand (collection/rkey)
- `client_did`: authenticated user's DID (required for shorthand format)

**Returns:**
- URIParts with repo, collection, and rkey

**Raises:**
- `ValueError`: if URI format is invalid or shorthand used without authentication

