How beanhsiang/embedding-markitdown-into-dotnet-demo works
Main Components
• .NET Application: Represented by the CSharpConsoleApp (located in the dotnet directory). This is the primary driver that initializes the Python environment, invokes the Python script, and displays the results.
• Python Script/Environment: Found in the python directory (demo.py and requirements.txt). This component handles PDF processing via the MarkItDown library.
• Assets: A resource component that includes the PDF file (test.pdf) used for demonstration.
• Integration Layer: Although not explicitly a separate directory, consider the CSnakes.Runtime library integration as a key bridging element between the .NET application and the Python environment.
• External Dependencies: Note the use of MarkItDown (a Python library) and environment specifications like .NET 6.0+ SDK and Python 3.9+ (or as noted, Python 3.12 in the README).
Relationships and Interactions
• The .NET console application (CSharpConsoleApp) is the entry point. It is responsible for:
• Initializing and configuring the Python runtime.
• Invoking the Python script (demo.py) using CSnakes.Runtime.
• Receiving and processing the results generated by the Python script.
• The Python script uses the MarkItDown library:
• Processes the PDF document (assets/test.pdf).
• Returns extracted text or processed data back to the .NET application.
• A call from the .NET component to the Python component.
• Data flow from the assets (PDF file) into the Python script.
• The feedback from processing results being routed back into the .NET application.
Architectural Patterns and Design Principles
• Cross-language Integration: Emphasize how the project seamlessly integrates two different runtime environments (.NET and Python) using an interop library (CSnakes.Runtime).
Final Touches
• Every component is clearly visible and identifiable.
• Aim for a detailed yet clean visual separation of components and layers – the clearer the distinctions, the easier it will be for any stakeholder or team member to understand the embedded architecture.