Skip to main content

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.

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

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


Installation

pip install PyJget

For local development:

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

Quick start

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:

pytest

Build a distributable wheel:

pip install build hatchling
python -m build

Author

Shaik Abeedali — Founder and Core Architect of PyJget.


License

MIT License.

Release files for PyJget 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyJget 0.1.0
File Size Uploaded
pyjget-0.1.0.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyJget 0.1.0
File Interpreter ABI Platform
pyjget-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / pyjget-0.1.0.tar.gz

Download URL pyjget-0.1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cf70a7811edee5402e4f8f1fe528f1747ecf12f8d736cb0f0f3f1cc7c3c3a105
BLAKE2b-256 checksum
How to use checksums
5d76742b58166c557a10393340a4de3c35064450dc61784fb8eb94e78f7b2713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / pyjget-0.1.0-py3-none-any.whl

Download URL pyjget-0.1.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35a5808349232fc00933fd4839e3bf8026a872867002c30666bebb2cd2b66c09
BLAKE2b-256 checksum
How to use checksums
11a2f59f4752ef99a75d89c2641394e74a65e154858012dc738e6b2b16bfc10d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page