1. Pyfx Model

Pyfx’s model.

It applies and completes given JSONPath query on the current loaded JSON data.

  • query directly uses jsonpath_ng

  • auto-completion is achieved by home-made autocomplete

1.1. Auto-Completion Library

ANTLR4 based JSONPath Auto-Completion Module.

The auto-completion is achieved by implementing an AutoCompleteListener which extends ErrorListener and ParseListener based on syntax defined in JSONPath.g4 which is based on JSONPath and jsonpath_ng.

1.1.1. Auto Completion

autocomplete(current_input, query)

Uses JSONPathAutoCompleteListener to parse the query and return auto-completion options.

Parameters:
  • current_input (str) – the current query input

  • query (callback) – the query callback which can be used to get data.

1.1.2. JSONPathAutoCompleteListener

class JSONPathAutoCompleteListener(query)

Both an ErrorListener and JSONPathListener.

Based on the syntax error ANTLR4 returned to find the possible completions.