# andytsangchun/pyutil architecture

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

- Interactive diagram: https://gitdiagram.com/andytsangchun/pyutil
- Repository: https://github.com/andytsangchun/pyutil

## Overview

Project Analysis:
This is a Python utility library that provides various helper functions and utilities, organized into different modules. It's not a full-stack application but rather a collection of utility functions that can be imported and used in other Python projects.

##### Main Component Structure
- Utility modules as sub-components within the main container
- Clear separation between different utility categories

##### Module Organization
Create distinct modules for each utility file:
- arg_util: Argument handling utilities
- file_util: File operation utilities
- np_util: NumPy-related utilities
- py_logger: Logging utilities
- py_queue: Queue implementation utilities
- py_util: General Python utilities
- tf_util: TensorFlow-related utilities

##### Additional Elements

- Module categories

b. Version information:
- License type (Apache License 2.0)
- Compatibility requirements

##### Technical Details
- Package import paths
- Key function signatures
- Required Python version
- Installation methods

Remember to:
- Clear entry points for library users
- Independence of different utility modules
- Examples of common usage patterns
- Document any cross-module dependencies

This approach will provide a clear understanding of the library's architecture while maintaining the appropriate level of detail for a utility package.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Main["pyutil Library"]
        direction TB
        
        subgraph Core["Core Python Utilities"]
            direction TB
            PU["General Python Utilities"]:::core
            PL["Logging Utilities"]:::core
            PQ["Queue Implementation"]:::core
        end

        subgraph IO["I/O Operations"]
            direction TB
            FU["File Operations"]:::io
        end

        subgraph Scientific["Scientific Computing"]
            direction TB
            NU["NumPy Utilities"]:::scientific
            TU["TensorFlow Utilities"]:::scientific
        end

        subgraph Input["Input Processing"]
            direction TB
            AU["Argument Handling"]:::input
        end

        subgraph Config["Package Configuration"]
            direction TB
            INIT["Package Initialize"]:::config
            SETUP["Setup Configuration"]:::config
            REQ["Dependencies"]:::config
            DOC["Documentation"]:::config
            LOG["Change History"]:::config
            MAN["Package Manifest"]:::config
        end
    end

    %% Dependencies
    PU --> PL
    PU --> PQ
    NU --> PU
    TU --> NU
    AU --> PU
    FU --> PL

    %% External Dependencies
    EXT_NP[("NumPy ≥ 1.14")]:::external
    EXT_TF[("TensorFlow")]:::external
    EXT_SCREEN[("screeninfo")]:::external

    NU --> EXT_NP
    TU --> EXT_TF
    PU --> EXT_SCREEN

    %% Click Events
    click PU "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/py_util.py"
    click PL "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/py_logger.py"
    click PQ "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/py_queue.py"
    click FU "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/file_util.py"
    click NU "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/np_util.py"
    click TU "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/tf_util.py"
    click AU "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/arg_util.py"
    click INIT "https://github.com/AndyTsangChun/pyutil/blob/master/pyutil/__init__.py"
    click SETUP "https://github.com/AndyTsangChun/pyutil/blob/master/setup.py"
    click REQ "https://github.com/AndyTsangChun/pyutil/blob/master/requirements.txt"
    click DOC "https://github.com/AndyTsangChun/pyutil/blob/master/README.md"
    click LOG "https://github.com/AndyTsangChun/pyutil/blob/master/CHANGELOG.md"
    click MAN "https://github.com/AndyTsangChun/pyutil/blob/master/MANIFEST.in"

    %% Styling
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef io fill:#90EE90,stroke:#333,stroke-width:2px
    classDef scientific fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef input fill:#FFA07A,stroke:#333,stroke-width:2px
    classDef config fill:#E6E6FA,stroke:#333,stroke-width:2px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5

    %% Legend
    subgraph Legend
        direction TB
        L1["Core Utilities"]:::core
        L2["I/O Operations"]:::io
        L3["Scientific Computing"]:::scientific
        L4["Input Processing"]:::input
        L5["Configuration"]:::config
        L6["External Dependencies"]:::external
    end
```
