Replies: 2 comments
-
Hi @rob-ross, The only reference implementation I'm aware of is jsonpath-standard/jsonpath-reference-implementation, which is sadly archived, incomplete and stalled, and written in Rust. It might be worth reading the blog post linked from that repository. (You can find a more complete pest grammar for RFC 9535 here if you're interested). JPT from another of the spec's authors was (I think) never intended to be a complete implementation, but a tool used during RFC 9535 development. While jsonpath-ng and its predecessor are popular, I hesitate to call anything that predates RFC 9535 "standard". The most important difference between jsonpath-ng and any implementation of RFC 9535 is, for me, that RFC 9535 is read only and non-evaluating, and therefor appropriate in situations where JSONPath query authors are untrusted. python-jsonpath was started before I knew RFC 9535 (or its draft) existed, then retroactively changed to (almost) follow the spec. It includes features and uses techniques that are important for integration with another project. This project (jsonpath-rfc9535) was/is an academic exercise. It is what I imagine a reference implementation would look like, and I'd be happy to move the repository to a standard JSONPath organization if anyone wanted to base a reference implementation off it. (JSON P3 and Ruby JSON P3 are similar academic exercises for JavaScript and Ruby) PyPi downloads aside, I see far more GitHub traffic for python-jsonpath than I do for jsonpath-rfc9535. It seems most people are not concerned with strict adherence to a specification or interoperability between languages. - James |
Beta Was this translation helpful? Give feedback.
-
re : (You can find a more complete pest grammar for RFC 9535 here if you're interested). Well they have a format for everything, don't they? lol. This seems like a useful format to learn even if I'm not using PEST. I have formal regexes defined for a lot of these, but I also have this text file I made just to help me navigate the grammar. One of my goals with my own project was to give me something complicated enough to help me really learn Python, but not something so overwhelming that I would burn out and never finish it. I was working on a Python based project using wiktionary data and had started trying to use jsonpath-ng and I was frustrated that it didn't seem to work like the tutorials said it should work. So I decided to take a slight detour and write my own implementation, which I have now done. However, it's clear that I'm late to this RFC party, and realistically my first major Python app probably isn't going to be the most efficient. So I will continue to tinker on it here and there but I have no plans to try to get it adopted for widespread use. Now, another project I had planned was to port my Python project into Java, which is the language I am currently most experienced in. Although I haven't done much Java programming in the last couple of years. So I was going to use my Python->Java port to relearn old things and learn all the new bells and whistles added to Java recently. So as an exercise, porting my Python app to Java would still be useful. However, I'm probably better served in porting your python-jsonpath to Java instead of my own. I will still get the benefit of working in Java for a bit, while keeping my Python skills fresh at least by reading Python code. And I expect I will learn a lot more about Python working in someone else's codebase than just rehashing what I have written myself. Plus, I will end up with a useful Java library for my future needs, and gain insight into your python-jsonpath project, and perhaps be able to help contribute to it in the future.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When I look at PyPy download data, there seem to only be 3 JSONPath libraries with meaningful download data:
jsonpath-ng, (the Python "standard")
python-jsonpath (I think another one of your projects?),
jsonpath (is this the pre-ng fork?),
jsonpath-rfc9535 (this project)
Is there a "reference implementation" put out by the the IET working group for this spec? That is, an implementation used to compare the results of other implementations to? If so I imagine it would be perhaps in JavaScript?
Does the concept of a reference implementation per language exist? I.e., is there such a thing as a "Python or Java reference implementation for RFC 9535?" And if not formally, would you consider this project that reference implementation for Python, or would you consider jsonpath-ng the reference implementation, just by nature of its widespread use?
Beta Was this translation helpful? Give feedback.
All reactions