endplay.parsers.pbn
Parser for PBN files
Classes:
Functions:
|
Serialize a list of |
|
Serialize a list of |
|
Read a PBN file object into a list of |
|
Read a PBN string into a list of |
- class endplay.parsers.pbn.PBNDecoder
Bases:
objectClasses:
State(*values)Methods:
_get_comment(text, iscont)Returns the comment contained in text, and a flag which is set to True if the comment requires continuation or False otherwise
_parse_commentblock(curline)_parse_conttable(curline)_parse_meta(curline)_parse_none(curline)clear()parse_file(f)Parse a PBN file
Attributes:
- _get_comment(text: str, iscont: bool) tuple[str | None, bool]
Returns the comment contained in text, and a flag which is set to True if the comment requires continuation or False otherwise
- _parse_commentblock(curline: str) bool
- _parse_conttable(curline: str) bool
- _parse_meta(curline: str) bool
- _parse_none(curline: str) bool
- clear() None
- curtag: str | None
- curtags: dict[str, Any]
- lineno: int
- metadata: dict[str, Any]
- notes: dict[str, str]
- prevtags: dict[str, Any]
- endplay.parsers.pbn.dump(boards: list[Board], fp: IO[str]) None
Serialize a list of
Boardobjects to a PBN file
- endplay.parsers.pbn.dumps(boards: list[Board]) str
Serialize a list of
Boardobjects to a PBN string