# sylikc/pyexiftool architecture

> Architecture diagram of the GitHub repository sylikc/pyexiftool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sylikc/pyexiftool
- Repository: https://github.com/sylikc/pyexiftool

## Overview

##### Main Components

a. Core Components:
- ExifTool Base Class (fundamental layer)
- ExifToolHelper Class (middleware layer)
- ExifToolAlpha Class (experimental layer)
- External ExifTool Process (command-line tool)

b. Supporting Components:
- Constants Module
- Exceptions Module
- Helper Module
- Test Framework

**Top Layer: Client Applications**

**Middle Layers: PyExifTool Library**
- ExifToolAlpha (Experimental Features)
- ExifToolHelper (Common Operations)
- ExifTool Base Class (Core Functionality)

**Bottom Layer: External ExifTool Process**

##### Key Elements to Highlight

a. Class Hierarchy:

b. Process Communication:
- Batch mode communication channel
- JSON data flow between components

##### Specific Implementation Details

- Execute() and execute_json() methods in the base class
- Metadata extraction flows
- Batch processing mechanisms
- Error handling pathways
- Configuration file interactions

##### Notes for Implementation

- Use UML-style notation for class relationships
- Method signatures
- Error handling pathways
- Batch mode optimization

Remember to emphasize the three-tier class structure and the batch-mode communication pattern, as these are the key architectural features that make PyExifTool efficient and extensible.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Applications"]
        App1[Python Applications]
        App2[Scripts]
    end

    subgraph PyExifTool["PyExifTool Library"]
        subgraph Experimental["Experimental Layer"]
            Alpha["ExifToolAlpha Class<br>Extended Features"]:::experimental
        end

        subgraph Helper["Helper Layer"]
            ETHelper["ExifToolHelper Class<br>Common Operations"]:::helper
        end

        subgraph Core["Core Layer"]
            ETBase["ExifTool Base Class<br>execute()<br>execute_json()"]:::core
            Constants["Constants Module"]:::support
            Exceptions["Exceptions Module"]:::support
            HelperMod["Helper Module"]:::support
        end
    end

    subgraph External["External Dependencies"]
        ExifTool["Phil Harvey's ExifTool<br>(v12.15+)"]:::external
        Config["Configuration Files"]:::config
    end

    subgraph Testing["Test Framework"]
        BaseTests["Base Class Tests"]:::test
        HelperTests["Helper Class Tests"]:::test
        AlphaTests["Alpha Class Tests"]:::test
    end

    %% Relationships
    App1 & App2 --> Alpha & ETHelper
    Alpha --> ETHelper
    ETHelper --> ETBase
    ETBase <--> ExifTool
    ETBase --> Constants
    ETBase --> Exceptions
    ETBase --> HelperMod
    ExifTool --> Config
    BaseTests --> ETBase
    HelperTests --> ETHelper
    AlphaTests --> Alpha

    %% Click Events
    click ETBase "https://github.com/sylikc/pyexiftool/blob/master/exiftool/exiftool.py"
    click ETHelper "https://github.com/sylikc/pyexiftool/blob/master/exiftool/helper.py"
    click Alpha "https://github.com/sylikc/pyexiftool/blob/master/exiftool/experimental.py"
    click Constants "https://github.com/sylikc/pyexiftool/blob/master/exiftool/constants.py"
    click Exceptions "https://github.com/sylikc/pyexiftool/blob/master/exiftool/exceptions.py"
    click Testing "https://github.com/sylikc/pyexiftool/tree/master/tests/"
    click BaseTests "https://github.com/sylikc/pyexiftool/blob/master/tests/test_exiftool_*.py"
    click HelperTests "https://github.com/sylikc/pyexiftool/blob/master/tests/test_helper_*.py"
    click AlphaTests "https://github.com/sylikc/pyexiftool/blob/master/tests/test_alpha.py"
    click Config "https://github.com/sylikc/pyexiftool/blob/master/tests/files/my_makernotes.config"

    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef helper fill:#4CAF50,stroke:#2E7D32,color:white
    classDef experimental fill:#FFC107,stroke:#FFA000,color:black
    classDef external fill:#9E9E9E,stroke:#616161,color:white
    classDef support fill:#90CAF9,stroke:#64B5F6,color:black
    classDef test fill:#FF5722,stroke:#E64A19,color:white
    classDef config fill:#795548,stroke:#5D4037,color:white

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Helper Components"]:::helper
        L3["Experimental Features"]:::experimental
        L4["External Dependencies"]:::external
        L5["Support Modules"]:::support
        L6["Test Components"]:::test
        L7["Configuration"]:::config
    end
```
