jmespath / jmespath.py

JMESPath is a query language for JSON.
http://jmespath.org
MIT License
2.19k stars 181 forks source link

Add starts_with, ends_with, reverse functions #51

Closed jamesls closed 10 years ago

jamesls commented 10 years ago

I think these functions would be useful, but am open to hearing suggestions. I know that some of these can be accomplished with the array slicing JEP, but these arguably provide a more convenient way to do this (foo[::-1] vs. reverse(foo)).

mtdowling commented 10 years ago

Would reverse() only work on arrays? If not, would we still use array slicing to reverse strings?

mtdowling commented 10 years ago

I'm +1 for this.

jamesls commented 10 years ago

Awesome, I'll go ahead and get this rebased off of the latest develop branch.

jamesls commented 10 years ago

Yeah, I think we should make reverse() work on strings.

jamesls commented 10 years ago

New PR here: https://github.com/boto/jmespath/pull/64. Closing in favor of #64.