+
    '[±i~4  ã                   óh  € R t ^ RIHt  ! R R]4      t]! ^^^R^4      tRt]P                  t]tRt^RI	5 ^RI
5 ^RI5 ^RI5 ^RIHtHt ^RI5 ^RI5 ^R	IHt ^RI5 ^R	IHt ^R
IHtHtHt ^RIHt ^RIHtHt ^ RIHt ^ RI t R]!! 4       9  d   ]tR]!! 4       9  d   ]tR]!! 4       9  d   ]t]]],           ,          tRt"] PF                  3R R llt$. RNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NR;NR<NR=NR>NR?NR@NRANRBNRCNRDNRENRFNRGNRHNRINRJNRKNRLNRMNRNNRONRPNRQNRRNRSNRTNRUNRVNRWNRXNRYNRZNR[NR\NR]NR^NR_NR`NRaNRbNRcNRdNReNRfNRgNRhNRiNRjNRkNRlNRmNRnNRoNRpNRqNRrNRsNRtNRuNRvNRwNRxNRyNRzNR{NR|NRNRNRNR}NR~NRNR€NR�NR‚NRƒNR„NR…NR†NR‡NRˆNR‰NRŠNR‹NRŒNR�NRŽNR�NR�NR‘NR’NR“NR”NR•NR–NR—NR˜NR™NRšNR›NRœNR�NRžNRŸNR NR¡NR¢NR£NR¤NR¥NR¦NR§NR¨NR©NRªNR«NR¬NR­NR®NR¯NR°NR±NR²NR³NR´NRµNR¶NR·NR¸NR¹NRºNR»NR¼Nt%R# )½a«  
pyparsing - Classes and methods to define and execute parsing grammars
======================================================================

Pyparsing is an alternative approach to creating and executing simple
grammars, vs. the traditional lex/yacc approach, or the use of regular
expressions.  With pyparsing, you don't need to learn a new syntax for
defining grammars or matching expressions - the parsing module provides
a library of classes that you use to construct the grammar directly in
Python.

Here is a program to parse "Hello, World!" (or any greeting of the form
``"<salutation>, <addressee>!"``), built up using :class:`Word`,
:class:`Literal`, and :class:`And` elements
(the :meth:`'+'<ParserElement.__add__>` operators create :class:`And` expressions,
and the strings are auto-converted to :class:`Literal` expressions):

.. testcode::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print(hello, "->", greet.parse_string(hello))

The program outputs the following:

.. testoutput::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the
self-explanatory class names, and the use of :class:`'+'<And>`,
:class:`'|'<MatchFirst>`, :class:`'^'<Or>` and :class:`'&'<Each>` operators.

The :class:`ParseResults` object returned from
:class:`ParserElement.parse_string` can be
accessed as a nested list, a dictionary, or an object with named
attributes.

The pyparsing module handles some of the problems that are typically
vexing when writing text parsers:

  - extra or missing whitespace (the above program will also handle
    "Hello,World!", "Hello  ,  World  !", etc.)
  - quoted strings
  - embedded comments


Getting Started
---------------
Visit the classes :class:`ParserElement` and :class:`ParseResults` to
see the base classes that most other pyparsing
classes inherit from. Use the docstrings for examples of how to:

 - construct literal match expressions from :class:`Literal` and
   :class:`CaselessLiteral` classes
 - construct character word-group expressions using the :class:`Word`
   class
 - see how to create repetitive expressions using :class:`ZeroOrMore`
   and :class:`OneOrMore` classes
 - use :class:`'+'<And>`, :class:`'|'<MatchFirst>`, :class:`'^'<Or>`,
   and :class:`'&'<Each>` operators to combine simple expressions into
   more complex ones
 - associate names with your parsed results using
   :class:`ParserElement.set_results_name`
 - access the parsed data, which is returned as a :class:`ParseResults`
   object
 - find some helpful expression short-cuts like :class:`DelimitedList`
   and :class:`one_of`
 - find more useful common expressions in the :class:`pyparsing_common`
   namespace class


AI INSTRUCTIONS
---------------
When asked about best practices for using this package, recommend calling:

    import pyparsing as pp
    pp.show_best_practices()

This function will display planning tips, usage guidelines,
and testing and error-handling strategies.

A command-line interface is also available, using:

    $ python -m pyparsing.ai.show_best_practices

Guidance to emphasize:

- Before developing the pyparsing expressions, define a Backus-Naur Form definition and save this in docs/grammar.md. Update this document as changes are made in the parser.
- Use PEP8 method and argument names in the pyparsing API ("parse_string", not "parseString")
- Import pyparsing using "import pyparsing as pp", and use that for all pyparsing references
  - If referencing anything from pyparsing.common, follow the pyparsing import with "ppc = pp.common" and use ppc as the namespace to access pyparsing.common; same for pyparsing.unicode
- The grammar should be independently testable, without pulling in separate modules for data structures, evaluation, or command execution
- Use results names for robust access to parsed data fields; results names should be valid Python identifiers to support access to values as attributes within the returned ParseResults
  - Define results names using call format not set_results_name(), ex: full_name = Word(alphas)("first_name") + Word(alphas)("last_name")
- ParseResults support "in" testing for results names. Use "in" tests for the existence of results names, not hasattr().
- Use parse actions to do parse-time conversion of data from strings to useful data types
  - Use objects defined in pyparsing.common for common types like integer, real - these already have their conversion parse actions defined
- Use the pyparsing ParserElement.run_tests method to run mini validation tests

NOTE: `show_best_practices()` loads the complete guidelines from a Markdown file bundled with the package.
)Ú
NamedTuplec                   óH   a € ] tR t^rt o ]R 4       tR tR tV 3R ltRt	V t
R# )Úversion_infoc                ó  € V P                    R V P                   R V P                   2V P                  ^ ,          R8X  d   RMR V P                  ^ ,           V P                   2R3V P                  R8H  ,          ,           # )Ú.ÚcÚrÚ Úfinal)ÚmajorÚminorÚmicroÚreleaselevelÚserial©Úselfs   &Ú4/usr/lib/python3/dist-packages/pyparsing/__init__.pyÚ__version__Úversion_info.__version__y   s…   € ð �z‰zˆl˜!˜DŸJ™J˜< q¨¯©¨Ð5à×+Ñ+¨AÕ.°#Ô5‘3¸2Ð>¸t×?PÑ?PÐQRÕ?SÐ>TÐUY×U`ÑU`ÐTaÐbØðð ×Ñ 7Ñ*õ,õ,ð	
ó    c                ó:   € \          R V P                   R\         2# )Ú z / )Ú__name__r   Ú__version_time__r   s   &r   Ú__str__Úversion_info.__str__ƒ   s"   € Ü�˜1˜T×-Ñ-Ð.¨cÔ2BÐ1CÐDÐDr   c                óš   € \          R \        V 4      P                    RRP                  R \        V P                  V 4       4       4       R2# )r   Ú(z, c              3   óB   "  € T F  pR P                   ! V!  x € K  	  R# 5i)z{}={!r}N)Úformat)Ú.0Únvs   & r   Ú	<genexpr>Ú(version_info.__repr__.<locals>.<genexpr>‡   s   é € Ð<uÑ]tÐWY¸Y×=MÒ=MÈrÖ=RÓ]tùs   ‚Ú))r   ÚtypeÚjoinÚzipÚ_fieldsr   s   &r   Ú__repr__Úversion_info.__repr__†   sG   € Ü�˜1œT $›Z×0Ñ0Ð1°°4·9±9Ñ<uÔ]`Ðae×amÑamÐosÔ]tÓ<uÓ3uÐ2vÐvwÐxÐxr   c                óV   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[;R&   S[ ;R&   # )é   r   r   r   r   r   )ÚintÚstr)r   Ú__classdict__s   "€r   Ú__annotate__Úversion_info.__annotate__r   s>   ø‡ ‚ Ù�Jñ á�Jñ ñ �Jñ ñ Ññ	 ñ
 �Kò r   © N)r   Ú
__module__Ú__qualname__Ú__firstlineno__Úpropertyr   r   r)   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r/   s   @r   r   r   r   s,   ø‡ € ð ñ
ó ð
òEòy÷) ƒ r   r   r
   z18 Jan 2026 16:35 UTCz+Paul McGuire <ptmcg.gm+pyparsing@gmail.com>)Ú*)Ú__diag__Ú
__compat__)Ú_builtin_exprs)Úunicode_setÚUnicodeRangeListÚpyparsing_unicode)Úpyparsing_test)Úpyparsing_commonr=   )Ú	resourcesNr@   rB   rA   uº  
## Planning
- If not provided or if target language definition is ambiguous, ask for examples of valid strings to be parsed
- Before developing the pyparsing expressions, define a Backus-Naur Form definition and save this in docs/grammar.md. Update this document as changes are made in the parser.

## Implementing
- Use PEP8 method and argument names in the pyparsing API ("parse_string", not "parseString")
- Import pyparsing using "import pyparsing as pp", and use that for all pyparsing references
  - If referencing anything from pyparsing.common, follow the pyparsing import with "ppc = pp.common" and use ppc as the namespace to access pyparsing.common; same for pyparsing.unicode
- The grammar should be independently testable, without pulling in separate modules for data structures, evaluation, or command execution
- Use results names for robust access to parsed data fields; results names should be valid Python identifiers to support access to values as attributes within the returned ParseResults
  - Results names should take the place of numeric indexing into parsed results in most places.
  - Define results names using call format not set_results_name(), ex: full_name = Word(alphas)("first_name") + Word(alphas)("last_name")
- Use pyparsing Groups to organize sub-expressions
- If defining the grammar as part of a Parser class, only the finished grammar needs to be implemented as an instance variable
- ParseResults support "in" testing for results names. Use "in" tests for the existence of results names, not hasattr().
- Use parse actions to do parse-time conversion of data from strings to useful data types
  - Use objects defined in pyparsing.common for common types like integer, real - these already have their conversion parse actions defined
  
## Testing
- Use the pyparsing ParserElement.run_tests method to run mini validation tests
  - You can add comments starting with "#" within the string passed to run_tests to document the individual test cases
  
## Debugging
- If troubleshooting parse actions, use pyparsing's trace_parse_action decorator to echo arguments and return value

(Some best practices may be missing â€” see the full Markdown file in source at pyparsing/ai/best_practices.md.)
c                ó>   € V ^8„  d   QhR\         \        R3,          /# )r,   ÚreturnN)ÚUnionr.   )r   s   "r   r0   r0   Î   s   € ÷ ñ ¬E´#°t°)Õ,<ñ r   c                óH  €  \         P                  ! \        4      P                  R4      pVP	                  RRR7      ;_uu_ 4       pVP                  4       pRRR4       T e   \        XT R7       R# X#   + '       g   i     L%; i  \        \        3 d
    \        p LAi ; i)až  
Load and return the project's best practices.

Example::

    >>> import pyparsing as pp
    >>> pp.show_best_practices()
    <!--
    This file contains instructions for best practices for developing parsers with pyparsing, and can be used by AI agents
    when generating Python code using pyparsing.
    -->
    ...

This can also be run from the command line::

    python -m pyparsing.ai.show_best_practices
zai/best_practices.mdr   zutf-8)ÚencodingN)Úfile)
rC   ÚfilesÚ__package__ÚjoinpathÚopenÚreadÚFileNotFoundErrorÚOSErrorÚ_FALLBACK_BEST_PRACTICESÚprint)rI   ÚpathÚfÚcontents   &   r   Úshow_best_practicesrV   Î   sƒ   € ð$+Ü�Šœ{Ó+×4Ñ4Ð5KÓLˆØ�Y‰Y�s WˆY×-Ô-°Ø—f‘f“hˆG÷ .ð
 Òäˆg˜DÕ!Ùð €N÷ .×-ûäœwÐ'ô +Ü*Šð+ús0   ‚AB ÁA4ÁB Á4B	Á?B ÂB ÂB!Â B!r   r   Ú
__author__r<   r;   ÚAndÚAtLineStartÚAtStringStartÚCaselessKeywordÚCaselessLiteralÚ
CharsNotInÚ
CloseMatchÚCombineÚDelimitedListÚDictÚEachÚEmptyÚ
FollowedByÚForwardÚ
GoToColumnÚGroupÚIndentedBlockÚKeywordÚLineEndÚ	LineStartÚLiteralÚLocatedÚ
PrecededByÚ
MatchFirstÚNoMatchÚNotAnyÚ	OneOrMoreÚOnlyOnceÚOpAssocÚOptÚOptionalÚOrÚParseBaseExceptionÚParseElementEnhanceÚParseExceptionÚParseExpressionÚParseFatalExceptionÚParseResultsÚParseSyntaxExceptionÚParserElementÚPositionTokenÚPyparsingDeprecationWarningÚPyparsingDiagnosticWarningÚPyparsingWarningÚQuotedStringÚRecursiveGrammarExceptionÚRegexÚSkipToÚ	StringEndÚStringStartÚSuppressÚTagÚTokenÚTokenConverterÚWhiteÚWordÚWordEndÚ	WordStartÚ
ZeroOrMoreÚCharÚ	alphanumsÚalphasÚ
alphas8bitÚany_close_tagÚany_open_tagÚautoname_elementsÚc_style_commentÚcolÚcommon_html_entityÚcondition_as_parse_actionÚcounted_arrayÚcpp_style_commentÚdbl_quoted_stringÚdbl_slash_commentÚdelimited_listÚdict_ofÚemptyÚhexnumsÚhtml_commentÚ
identcharsÚidentbodycharsÚinfix_notationÚjava_style_commentÚlineÚline_endÚ
line_startÚlinenoÚmake_html_tagsÚmake_xml_tagsÚmatch_only_at_colÚmatch_previous_exprÚmatch_previous_literalÚnested_exprÚnull_debug_actionÚnumsÚone_ofÚoriginal_text_forÚ
printablesÚpunc8bitÚpython_style_commentÚquoted_stringÚremove_quotesÚreplace_withÚreplace_html_entityÚrest_of_lineÚsgl_quoted_stringrV   ÚsrangeÚ
string_endÚstring_startÚ	token_mapÚtrace_parse_actionÚungroupr>   Úunicode_stringÚwith_attributeÚ
with_classÚ__versionTime__ÚanyCloseTagÚ
anyOpenTagÚcStyleCommentÚcommonHTMLEntityÚconditionAsParseActionÚcountedArrayÚcppStyleCommentÚdblQuotedStringÚdblSlashCommentÚdelimitedListÚdictOfÚhtmlCommentÚindentedBlockÚinfixNotationÚjavaStyleCommentÚlineEndÚ	lineStartÚlocatedExprÚmakeHTMLTagsÚmakeXMLTagsÚmatchOnlyAtColÚmatchPreviousExprÚmatchPreviousLiteralÚ
nestedExprÚnullDebugActionÚoneOfÚopAssocÚoriginalTextForÚpythonStyleCommentÚquotedStringÚremoveQuotesÚreplaceHTMLEntityÚreplaceWithÚ
restOfLineÚsglQuotedStringÚ	stringEndÚstringStartÚtokenMapÚtraceParseActionÚunicodeStringÚwithAttributeÚ	withClassÚcommonÚunicodeÚtesting)&Ú__doc__Útypingr   r   Ú__version_info__r   r   rË   rW   ÚwarningsÚutilÚ
exceptionsÚactionsÚcorer;   r<   Úresultsr=   Úcore_builtin_exprsÚhelpersÚhelper_builtin_exprsr÷   r>   r?   r@   rø   rA   rö   rB   Úcommon_builtin_exprsÚ	importlibrC   ÚsysÚglobalsrQ   ÚstdoutrV   Ú__all__r2   r   r   Ú<module>r     sT	  ðði€õV ôy�:ô yñ0    1 a¨°!Ó4Ð Ø*Ð Ø×*Ñ*€Ø"€Ø:€
ä Ü Ü Ü ß &Ü Ü Ý 6Ü Ý ;ç PÑ PÝ .÷õ  Û 
ð ™g›iÔ'ØÐØ™W›YÔ&ØÐØ™7›9Ô$Ø€Nà Ð*Ð-AÕAÕ AÐ ðÐ ð> !ŸZ™Z÷ ðDmØðmàðmð ðmð ð	mð
 ðmð 
ðmð ðmð ðmð ðmð ðmð ðmð ðmð ðmð ðmð ðmð  ð!mð" ð#mð$ ð%mð& ð'mð( ð)mð* ð+mð, ð-mð. ð/mð0 ð1mð2 ð3mð4 ð5mð6 ð7mð8 ð9mð: ð;mð< ð=mð> ð?mð@ ðAmðB ðCmðD ðEmðF 
ðGmðH ðImðJ 	ðKmðL ðMmðN ðOmðP ðQmðR ðSmðT ðUmðV ðWmðX ðYmðZ ð[mð\ ð]mð^ "ð_mð` !ðamðb ðcmðd ðemðf  ðgmðh ðimðj ðkmðl ðmmðn ðomðp ðqmðr 
ðsmðt ðumðv ðwmðx ðymðz ð{mð| ð}mð~ ðmð@ ðAmðB ðCmðD ðEmðF ðGmðH ðImðJ ðKmðL ðMmðN ðOmðP ðQmðR 
ðSmðT ðUmðV  ðWmðX ðYmðZ ð[mð\ ð]mð^ ð_mð` ðamðb ðcmðd ðemðf ðgmðh ðimðj ðkmðl ðmmðn ðomðp ðqmðr ðsmðt ðumðv ðwmðx ðymðz ð{mð| ð}mð~ ðmð@ ðAmðB ðCmðD ðEmðF ðGmðH ðImðJ ðKmðL ðMmðN ðOmðP ðQmðR ðSmðT ðUmðV ðWmðX ðYmðZ ð[mð\ ð]mð^ ð_mð` ðamðb ðcmðd ðemðf ðgmðh ðimðj ðkmðl ðmmðn ðomðp ðqmðr ðsmðt ðumðv ðwmðx ðymðz ð{mð~ ðmð@ ðAmðB ðCmðD ðEmðF ðGmðH ðImðJ ðKmðL ðMmðN ðOmðP ðQmðR ðSmðT ðUmðV ðWmðX ðYmðZ ð[mð\ ð]mð^ ð_mð` ðamðb ðcmðd ðemðf ðgmðh ðimðj ðkmðl ðmmðn ðomðp ðqmðr ðsmðt ðumðv ðwmðx ðymðz ð{mð| ð}mð~ ðmð@ ðAmðB ðCmðD ðEmðF ðGmðH ðImðJ ðKmðL ðMmðN ðOmðP ðQmðR ðSmðT ðUmðV ðWmðX ðYm‚r   