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.1.tar.gz (10.0 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.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: schlibs-0.1.1.tar.gz
  • Upload date:
  • Size: 10.0 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.1.tar.gz
Algorithm Hash digest
SHA256 e9e3e2b174107dd271677f02dd67d9873c218602ad3d9202a90269416b1ebfc1
MD5 4a90abb1e555bc1c24222362d6e54a82
BLAKE2b-256 60cd91abfab6111ff8e309683408eeecb74465017d9a4631a372f75c047bc5a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: schlibs-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee55d54a66c82a7324d83b01aa408930ef62af2d503d8bca6b6e15cf213f88e
MD5 8430eca6e506b89a282b8edbfefe1534
BLAKE2b-256 7662c195a9aac6ac0137c3e6fbc32b3c17c1cf83e7545f5a67fd2db9d28df7f4

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