Skip to main content

A jsonpath cli implementation powered by treepath technology.

Project description

The jsonpath_cli Package.

The jsonpath_cli is an extension to jsonpath_tp implementation built on top of treepath technology.

Quick Start Command Line Interface

To use the cli install the jsonpath_cli python package in a venv:

python -m venv venv
source bin venv/bin/activate
pip install jsonpath_cli

A jsonpath example that gets c's value from json data. jsonpath "$.star.planets.inner[?(@.name=='Earth')].name" tests/data/solar-system.json

"Earth"

Solar System Json Document

The examples shown in this README use the following json document. It describes our solar system. Click to expand.

solar_system = {...}

{
  "star": {
    "name": "Sun",
    "diameter": 1391016,
    "age": null,
    "planets": {
      "inner": [
        {
          "name": "Mercury",
          "Number of Moons": "0",
          "diameter": 4879,
          "has-moons": false
        },
        {
          "name": "Venus",
          "Number of Moons": "0",
          "diameter": 12104,
          "has-moons": false
        },
        {
          "name": "Earth",
          "Number of Moons": "1",
          "diameter": 12756,
          "has-moons": true
        },
        {
          "name": "Mars",
          "Number of Moons": "2",
          "diameter": 6792,
          "has-moons": true
        }
      ],
      "outer": [
        {
          "name": "Jupiter",
          "Number of Moons": "79",
          "diameter": 142984,
          "has-moons": true
        },
        {
          "name": "Saturn",
          "Number of Moons": "82",
          "diameter": 120536,
          "has-moons": true
        },
        {
          "name": "Uranus",
          "Number of Moons": "27",
          "diameter": 51118,
          "has-moons": true
        },
        {
          "name": "Neptune",
          "Number of Moons": "14",
          "diameter": 49528,
          "has-moons": true
        }
      ]
    }
  }
}

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

jsonpath_cli-0.0.1.dev0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

jsonpath_cli-0.0.1.dev0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file jsonpath_cli-0.0.1.dev0.tar.gz.

File metadata

  • Download URL: jsonpath_cli-0.0.1.dev0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for jsonpath_cli-0.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 948487c459c186ee359805773a24519a45bc566beda3bc8227ac925bb3c18b90
MD5 dae2a2b055bb358e406b52953c5534b8
BLAKE2b-256 9c211a62fd79f518b435e7a67196dcf5e0739d593477b68552db39ba6b4c0456

See more details on using hashes here.

File details

Details for the file jsonpath_cli-0.0.1.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for jsonpath_cli-0.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7849901414c9aacf80d8728722794f32032519778d52aebc57f5e412384f821
MD5 80039ae0c24e2371299eb1f4a1d55d86
BLAKE2b-256 60e681c8a9161a01b77b439c4173a2be6551b35a3a330428e0eec904df2ae01b

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