7. Queries¶
Queries are modules for data selection from various sources like HTML, XML, JSON, TXT, etc.
Currently easy data has 4 query components, which should cover most of situations.
PyQuerySearch (pq) - is a css selector based on package
pyquery
, which offers jquery-like syntax.JMESPathSearch (jp) - is a json selector based on jmespath package, which helps you to select deeply nested data with ease. Please note that on a simple 1 level dictionaries, it’s preferred to use key query instead due to performance reasons
KeySearch (key) - is a simple key based selector to be used on a dictionary.
ReSearch (re) - is a regex based selector with a regex pattern as a query selector.
OrClause (cor) -
or
clause which can accept 2 or more query selectors and return results from the first matching query selectorWithClause (cwith) -
with
clause which can accept 2 or more query selectors and process data in a sequence