# bradodarb/schleppy architecture

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

- Interactive diagram: https://gitdiagram.com/bradodarb/schleppy
- Repository: https://github.com/bradodarb/schleppy

## Overview

##### Project Type and Purpose
- This is a Python utility library (pure‐Python package) named “schleppy.”
- It provides two core data‐structure utilities:
a. reach() – traverse an object via a key‐chain pattern
b. transform() – reshape or map objects (or lists of objects) based on a transform specification
- Supporting modules:
- json_utils.py – JSON‐related helpers
- string_utils.py – key‐chain parsing/joining, etc.
- transform.py – implements the transform API, relies on reach + string_utils
- reach.py – implements the reach API

##### High‐Level File Structure Analysis
- Top‐level:
- setup.py – packaging metadata for PyPI, installation
- README.md, LICENSE, .gitignore, etc. – documentation & config
- Makefile – common tasks (e.g., test, build)
- Package directory “schleppy/”: core modules
- Test directory “test/”: unit tests for each module, test requirements

##### Key Insights from README
- No servers, frontends, or databases – it is a library.
- Describes API signatures, options, examples for reach() and transform().

##### Main Components & Their Relationships
A. Package Modules
1. reach.py
2. transform.py
3. json_utils.py
4. string_utils.py
5. __init__.py (exports reach & transform)
B. Test Suite
- test/json_utils_test.py
- test/reach_unit_test.py
- test/transform_unit_test.py
C. Packaging & Build
- setup.py
- Makefile
- test/requirements.txt
D. External Consumer
- Any Python application that ‘pip install schleppy’ and calls reach/transform

Relationships:
- transform.py → imports reach() + string_utils for path resolution
- reach.py → imports string_utils to parse the pattern
- json_utils.py → may import both reach and transform for JSON‐based operations
- __init__.py → re-exports reach & transform API at package level
- tests → import each module to validate behavior
- setup.py → includes package modules, triggers tests via Makefile

##### Architectural Patterns & Principles
- Functional decomposition: each module has a single responsibility
- Composition: transform composes reach and string utilities
- Pure functions with optional configuration via options dict
- Test‐driven design: tight unit test coverage

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core API Modules
    subgraph "Core API"
        R["reach.py"]:::core
        T["transform.py"]:::core
        I["__init__.py"]:::core
    end

    %% Utility Modules
    subgraph "Utilities"
        S["string_utils.py"]:::util
        J["json_utils.py"]:::util
    end

    %% Packaging & Build
    subgraph "Packaging & Build"
        SP["setup.py"]:::pkg
        MK["Makefile"]:::pkg
        TR["test/requirements.txt"]:::pkg
    end

    %% Test Suite
    subgraph "Test Suite"
        TJ["json_utils_test.py"]:::test
        TRc["reach_unit_test.py"]:::test
        TT["transform_unit_test.py"]:::test
    end

    %% External Consumer
    EC["External Consumer"]:::consumer

    %% Dependencies
    R -->|"imports"| S
    T -->|"imports"| R
    T -->|"imports"| S
    J -->|"imports"| R
    J -->|"imports"| T
    I -->|"exports API"| R
    I -->|"exports API"| T

    SP -->|"packages"| I
    MK -->|"runs"| SP
    MK -->|"runs tests"| TJ
    MK -->|"runs tests"| TRc
    MK -->|"runs tests"| TT

    TJ -->|"tests"| J
    TRc -->|"tests"| R
    TT -->|"tests"| T

    EC -->|"uses"| I

    %% Click Events
    click R "https://github.com/bradodarb/schleppy/blob/master/schleppy/reach.py"
    click T "https://github.com/bradodarb/schleppy/blob/master/schleppy/transform.py"
    click J "https://github.com/bradodarb/schleppy/blob/master/schleppy/json_utils.py"
    click S "https://github.com/bradodarb/schleppy/blob/master/schleppy/string_utils.py"
    click I "https://github.com/bradodarb/schleppy/blob/master/schleppy/__init__.py"
    click TJ "https://github.com/bradodarb/schleppy/blob/master/test/json_utils_test.py"
    click TRc "https://github.com/bradodarb/schleppy/blob/master/test/reach_unit_test.py"
    click TT "https://github.com/bradodarb/schleppy/blob/master/test/transform_unit_test.py"
    click SP "https://github.com/bradodarb/schleppy/blob/master/setup.py"
    click MK "https://github.com/bradodarb/schleppy/tree/master/Makefile"
    click TR "https://github.com/bradodarb/schleppy/blob/master/test/requirements.txt"

    %% Styles
    classDef core fill:#AED6F1,stroke:#1F618D,color:#1F618D
    classDef util fill:#A9DFBF,stroke:#229954,color:#145A32
    classDef pkg fill:#D5D8DC,stroke:#808B96,color:#515A5A
    classDef test fill:#F9E79F,stroke:#B7950B,color:#7D6608
    classDef consumer fill:#D2B4DE,stroke:#8E44AD,color:#512E5F
```
