Metadata-Version: 2.4
Name: PyJget
Version: 0.1.0
Summary: PyJget — lightweight nested JSON and dict path extraction using dot notation.
Project-URL: Homepage, https://github.com/abeedalishaik1080-lab/PyJget
Project-URL: Documentation, https://github.com/abeedalishaik1080-lab/PyJget#readme
Project-URL: Repository, https://github.com/abeedalishaik1080-lab/PyJget
Project-URL: Issues, https://github.com/abeedalishaik1080-lab/PyJget/issues
Author: Shaik Abeedali
License-Expression: MIT
Keywords: PyJget,dict,dot-notation,jget,json,nested,path
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# PyJget

**PyJget** is a tiny, type-safe Python library for extracting nested values from dictionaries and lists using intuitive dot-notation paths — including list indexing with bracket syntax.

```python
get_path(data, "users[0].address.city")
```

No dependencies. No JSON parsing overhead. Just clean, predictable path navigation.

---

## Installation

```bash
pip install PyJget
```

For local development:

```bash
git clone https://github.com/shaikabeedali/PyJget.git
cd PyJget
pip install -e ".[dev]"
```

---

## Quick start

```python
from pyjget import get_path

data = {
    "users": [
        {"name": "Ada", "address": {"city": "London"}},
        {"name": "Grace", "address": {"city": "New York"}},
    ],
    "meta": {"count": 2},
}

# Nested dict access
get_path(data, "meta.count")                  # 2

# List indexing with dot notation
get_path(data, "users[0].name")               # "Ada"
get_path(data, "users[1].address.city")       # "New York"

# Safe defaults for missing paths
get_path(data, "users[9].name", default="n/a") # "n/a"
get_path(data, "meta.missing")                # None
```

---

## Path syntax

| Path | Description |
|------|-------------|
| `key` | Top-level dictionary key |
| `a.b.c` | Nested dictionary keys |
| `items[0]` | List index at a key |
| `items[0].name` | Mixed dict and list navigation |
| `matrix[1][0]` | Multiple indices in one segment |

Paths that are empty, malformed, or point to missing keys return the provided `default` (or `None` if omitted).

---

## API

### `get_path(data, path, default=None)`

| Parameter | Type | Description |
|-----------|------|-------------|
| `data` | `dict` or `list` | Root structure to traverse |
| `path` | `str` | Dot-notation path (e.g. `users[0].address.city`) |
| `default` | `Any` | Value returned when lookup fails |

**Returns:** The resolved value, or `default`.

---

## Development

Run the test suite:

```bash
pytest
```

Build a distributable wheel:

```bash
pip install build hatchling
python -m build
```

---

## Author

**Shaik Abeedali** — Founder and Core Architect of PyJget.

---

## License

MIT License.
