Skip to main content

Shared libraries for JSON-Path/JSON-Pointer conversion and pointer caching

Project description

schlibs - Shared Libraries

A BDD-driven library providing utilities for JSON-Path/JSON-Pointer conversion and pointer caching.

Features

json_pathlib

Bidirectional conversion between JSON-Path and JSON-Pointer formats:

  • JSON-Pointer → JSON-Path: Straightforward conversion
  • JSON-Path → JSON-Pointer: Resolves expressions against actual documents
  • Supports wildcards and filter expressions that may produce multiple results
from json_pathlib import pointer_to_path, path_to_pointer, path_to_pointers

# Simple conversion
path = pointer_to_path("/store/book/0/title")
# Result: "$.store.book[0].title"

# Resolve JSON-Path against a document
doc = {"store": {"book": [{"title": "Book 1"}, {"title": "Book 2"}]}}
pointer = path_to_pointer("$.store.book[0].title", doc)
# Result: "/store/book/0/title"

# Multiple results with wildcards
pointers = path_to_pointers("$.store.book[*].title", doc)
# Result: ["/store/book/0/title", "/store/book/1/title"]

pointercache

Caching system with configurable eviction policies (coming soon).

Installation

pip install schlibs

Development

This is a dual-language library project (Python + TypeScript) using behavior-driven development:

cd python/

# Install dev dependencies
pip install -e ".[dev]"

# Run BDD tests
behave

# Run unit tests
pytest

License

MIT License - see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schlibs-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

schlibs-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file schlibs-0.1.0.tar.gz.

File metadata

  • Download URL: schlibs-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for schlibs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a79659215f53acfa3bd887e24a5f48f969c3c19a6c94c60f4b8786398e74db78
MD5 1e51caf6e92a45ff16b8b8b928094d99
BLAKE2b-256 efc3e8e9776273c207a2144fe95add3936b657819de324afc9b329d71f599a26

See more details on using hashes here.

File details

Details for the file schlibs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: schlibs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for schlibs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 580430cdd7a21fa1aedf8c5f6089c9f098de1ce45ec6a5ce3c6536efcc7547f2
MD5 f67aba54074c7dbfb84ab194905a8a63
BLAKE2b-256 025763a3fdb95da8ea794b1331a8def2ef3cf87e9f8fa3b22c7f244fc159ef9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page