jpath

Access nested dicts and lists using JSON-like path notation
Download

jpath Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Python License
  • Price:
  • FREE
  • Publisher Name:
  • Radomir Dopieralski
  • Publisher web site:
  • http://hatta.sheep.art.pl/

jpath Tags


jpath Description

Access nested dicts and lists using JSON-like path notation jpath is a Python library that allows you to access nested dicts and lists using JSON-like path notation.Note that this code is written for Python 3.The notation is as follows: You can just write the names of components in your path like you would in javascript: foo.bar.baz To access arrays or names with spaces in them, use the '[]' notation. You can use negative indices with arrays to count from the end. array.attr You can use the wildcard character '*' to iterate over all elements: foo.*.baz This may return more or less than a single element. Use get to get the first one, and get_all to get a list of all possibilities. If you want to skip any number of elements in path, use two dots '..': foo..baz You can slice the arrays just like in python: array Finally, you can filter the elements: foo(bar.baz=true) foo.bar(baz>0).baz foo(bar="yawn").bar At the moment only =, >, =, Requirements: · Python


jpath Related Software