Metadata-Version: 2.4
Name: minimindslab-json-pointer
Version: 0.1.0
Summary: Parse, validate, and resolve RFC 6901 JSON Pointer paths against Python dict/list structures.
Author: MiniMindsLab
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MiniMindsLab JSON Pointer

A tiny, deterministic, standard-library-only implementation of core RFC 6901 JSON Pointer behavior for Python dict/list structures.

## Features

- Parse JSON Pointer strings into decoded tokens
- Validate pointer syntax
- Resolve values from nested dict/list objects
- Check pointer existence
- Return updated copies via immutable-style `set_value`

## Installation

This package is designed as a lightweight library with no runtime dependencies.

## Quick Start

```python
from minimindslab_json_pointer import parse_pointer, get_value, has_pointer, set_value

parse_pointer('/a~1b/c~0d')
# ['a/b', 'c~d']

get_value({'a': [{'b': 3}]}, '/a/0/b')
# 3

has_pointer({'x': 1}, '/x')
# True

updated = set_value({}, '/a/b', 2)
# {'a': {'b': 2}}
```

## API

- `parse_pointer(pointer: str) -> list[str]`
- `is_valid_pointer(pointer: str) -> bool`
- `get_value(document, pointer: str)`
- `has_pointer(document, pointer: str) -> bool`
- `set_value(document, pointer: str, value)`

## Notes

- Empty pointer `""` references the entire document.
- Pointer must start with `/` unless empty.
- Escape handling follows RFC 6901 (`~1` => `/`, `~0` => `~`).
