Skip to content

Update pyparsing API: parseString → parse_string #90

Description

@interplanetarychris

Summary

edtf 5.0.0 uses deprecated pyparsing method names, causing DeprecationWarnings with pyparsing 3.2+:

DeprecationWarning: 'parseString' deprecated - use 'parse_string'
  File ".../edtf/parser/grammar.py", line 352

The Issue

pyparsing 3.1+ deprecated camelCase method names in favor of PEP8 snake_case:

  • parseString()parse_string()
  • parseAll param → parse_all

These will be removed in pyparsing 4.0.

Suggested Fix

pyparsing 3.2.2 includes a migration tool:

python -m pyparsing.tools.cvt_pep8_names -u edtf/parser/grammar.py

Or manually update line 352 in edtf/parser/grammar.py:

# Before
p = edtfParser.parseString(input_string.strip(), parseAll)

# After  
p = edtfParser.parse_string(input_string.strip(), parse_all=parseAll)

Environment

  • Python 3.12
  • edtf 5.0.0
  • pyparsing 3.2.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions