Skip to content

# `` pyparsing_compat

Compatibility helpers for supporting pyparsing v2 and v3 APIs.

Functions:

- `combine_join_kwargs` –

Attributes:

- `DelimitedList` (`_ParserFactory`) –
- `PYPARSING_MAJOR_VERSION` –
- `PYPARSING_V3` –
- `ParseResults` –
- `ParserElement` –
- `original_text_for` (`_ParserTransform`) –
- `rest_of_line` (`ParserElement`) –

## `` DelimitedList `module-attribute`

    DelimitedList: _ParserFactory

## `` PYPARSING_MAJOR_VERSION `module-attribute`

    PYPARSING_MAJOR_VERSION = int(split('.', 1)[0])

## `` PYPARSING_V3 `module-attribute`

    PYPARSING_V3 = PYPARSING_MAJOR_VERSION >= 3

## `` ParseResults `module-attribute`

    ParseResults = ParseResults

## `` ParserElement `module-attribute`

    ParserElement = ParserElement

## `` original_text_for `module-attribute`

    original_text_for: _ParserTransform

## `` rest_of_line `module-attribute`

    rest_of_line: ParserElement

## `` combine_join_kwargs

    combine_join_kwargs(value: str) -> Dict[str, str]

Source code in `rdflib/plugins/sparql/pyparsing_compat.py`

     97
     98
     99
    100

    def combine_join_kwargs(value: str) -> Dict[str, str]:
        if PYPARSING_V3:
            return {"join_string": value}
        return {"joinString": value}