JMESPath — это язык запросов, позволяющий декларативно извлекать данные из JSON-документов.
Допустим, у нас есть JSON:
{"foo": {"bar": "baz"}}Запрос foo.bar вернёт "baz".
{"foo": {"bar": ["one", "two"]}}Запрос foo.bar[0] вернёт "one", а foo.bar[-1] — "two".
{"foo": {"bar": [{"name": "one"}, {"name": "two"}]}}Запрос foo.bar[*].name вернёт ["one", "two"].
{"foo": {"bar": {"name": "one"}, "baz": {"name": "two"}}}Запрос foo.*.name вернёт ["one", "two"].
#JMESPath #JSON #DataProcessing #Automation #Python #Programming
https://github.com/jmespath/jmespath.py
Please open Telegram to view this post
VIEW IN TELEGRAM
GitHub
GitHub - jmespath/jmespath.py: JMESPath is a query language for JSON.
JMESPath is a query language for JSON. Contribute to jmespath/jmespath.py development by creating an account on GitHub.
1🔥4👍1