Parsers ======= The first step of working with Parsers is to implement all the parsers you need based on one of three provided base classes: :class:`~.PDFBaseParser`, :class:`~.EmailBaseParser` and :class:`~.FileBaseParser`. The second step is to create an instance of :class:`~.ParserHandler`, which automatically loads all the parsers based on provided input arguments. And finally, to parse our input data, we can call :meth:`~.ParserHandler.parse` method, which will select the correct parser and parse the input data based on provided Parsing Strategy. See parameter ``parse_strategy`` in :class:`~.ParserHandler`. .. autoclass:: aiviro.modules.parser.PDFBaseParser :inherited-members: .. autoclass:: aiviro.modules.parser.EmailBaseParser :inherited-members: .. autoclass:: aiviro.modules.parser.FileBaseParser :inherited-members: .. automodule:: aiviro.modules.parser :members: ParserHandler, BaseParsingStrategy, NaiveParsingStrategy, AutoSelectParsingStrategy, ParserInvalidCheck, ParserNotFound, ParserProcessingError Examples -------- Here is an example of how to implement several PDF parsers, where each parser is responsible for parsing a specific type of PDF file. In this case, each supplier sends us a PDF file with a different structure, and we need to parse the data from these files. .. literalinclude:: ../../code_examples/pdf_parsers.py