question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Add support for JMESPath

See original GitHub issue

Building a Selector based on JMESPath in parsel will help ease parsing Json. This will also help scrapy to add methods like add_json and get_json to the ItemLoader. I got this idea from scrapy/scrapy#1005. From what I understand, the Selector in parsel has been built using lxml, how about using jmespath for building a JsonSelector ?

I am not sure if this is the feature to have in this library as Parsel describes itself as a parser for XML/HTML. But adding this feature will add great value to this project.

PS: If the maintainers would like to have this feature in, Than I’d like to contribute to it myself.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:23 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
Granitosauruscommented, Nov 16, 2020

Not to derail this but I’d argue that implementing JSONpath[1] would actually be more fitting for parsel as it is xpath like. For example Jmespath doesn’t support recursive queries (like //node xpath) while Jsonpath does (as $..node); also the whole protocol structure is much more similar to that of xpath.

Ideally it would be great to have both! More and more web is using json and would be great to have one good parser for both html and json.

1 - https://github.com/h2non/jsonpath-ng jsonpath implementation in Python

1reaction
xPi2commented, Jul 28, 2020

How is going this? I’m trying to implement this myself over parsel selector in my own project but I’m sure you know how to do it better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conditional Transformer with support for JMESPATH - Alumio
Hi, In most cases 'string' fields (like in Value Setter) support JMESPATH. But a Conditional Transformer ... Discussions Alumio Forums Feature Requests ......
Read more >
Git Integration for Jira Data Center - Confluence - Atlassian
Pull/merge requests created via the git integration developer panel in the Jira issue will automatically add a link to the Jira issue where...
Read more >
GitLab JMESPath Filter Examples | Git Integration for Jira Self ...
An optional JMESPath filter can be configured when adding GitLab integration or repositories. 1. Contains (include). [?contains(name, 'git') | contains(name ...
Read more >
Filter for Specific Fields (JMESPath) [2022] | API Connector
To view the raw JSON, set up and save your request, and then click Output options > More options > JMESPath > View...
Read more >
JMESPath - Kyverno
JMESPath expressions in most places in Kyverno must be enclosed in double curly braces like {{request.namespace}} . If an expression is used as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found