How brokdar/arxmldataextractor works
Project Type and Purpose
• Project Type: An open-source, command-line Python tool (library + executable) for extracting structured data from AUTOSAR .arxml files.
• Purpose: Users supply a YAML “configuration file” that defines what XML elements to extract; the tool parses the .arxml, applies XPath and reference logic, and writes results in .txt, .json, or .xlsx formats.
File Structure
• Top level
• .github, .gitignore, .vscode, LICENSE, README.md, requirements.txt – CI/CD, editor settings, licensing, documentation, Python dependencies.
• arxml_data_extractor/ – core Python package.
• arxml_data_extractor/
• __main__.py – CLI entry point.
• config_provider.py – loads and validates YAML config.
• asr/asr_parser.py – parses the .arxml into an XML/DOM tree, handles namespaces.
• query_builder.py – translates config into internal “Query” objects.
• query_handler.py – executes queries against the parsed XML.
• data_writer.py – collects query results.
• output/ – individual writers: text_writer.py, excel_writer.py, tabularize.py (json likely built-in).
• handler/ – low-level handlers for object, path, value extraction.
• query/ – domain models for data_object, data_query, data_value.
• tests/ – unit and integration tests covering all modules.
Insights from the README
• Describes features: XPath extraction, AUTOSAR reference resolution (_ref, _xref), nested objects, inline references, value conversions.
• Usage pattern: CLI flags → config → input .arxml → output file & format.
• Emphasizes extensibility via configuration and pluggable output modules.