# mikemoore63/spdx_matcher architecture

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

- Interactive diagram: https://gitdiagram.com/mikemoore63/spdx_matcher
- Repository: https://github.com/mikemoore63/spdx_matcher

## Overview

spdx_matcher is a Python library for identifying SPDX licenses and exceptions in text. The primary workflow accepts license text, normalizes it, and returns exact-match details; fuzzy matching is an optional alternative that returns scored candidates. The package also includes a filesystem-scanning demo that can analyze and store license content in Google Cloud Storage. The excerpts show the demo’s calls, but do not expose the full matcher implementation, so internal matching stages are kept broad.

Main entry points: [`src/spdx_matcher/__init__.py`](https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py) (Matcher API), [`demo.py`](https://github.com/mikemoore63/spdx_matcher/blob/main/demo.py) (Filesystem scanner demo), [`src/spdx_matcher/data_models.py`](https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/data_models.py) (Matcher models)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Library caller"))
node_api["Matcher API<br/>[__init__.py]"]
node_normalization["Text normalization<br/>[__init__.py]"]
node_matchers["License matching<br/>[__init__.py]"]
node_matcher_models["Matcher models<br/>[data_models.py]"]
node_fuzzy["Fuzzy matching<br/>[__init__.py]"]
node_results["Match results"]
node_scanner_demo["Filesystem scanner demo<br/>[demo.py]"]
node_filesystem[("Local files")]
node_cloud_storage[("Google Cloud Storage")]

node_user -->|"submits text"| node_api
node_api -->|"normalizes text"| node_normalization
node_api -->|"matches license"| node_matchers
node_matchers -->|"returns details"| node_results
node_user -.->|"requests fuzzy match"| node_fuzzy
node_fuzzy -->|"returns scores"| node_results
node_api -->|"imports models"| node_matcher_models
node_scanner_demo -->|"reads files"| node_filesystem
node_scanner_demo -->|"calls matcher"| node_api
node_scanner_demo -->|"uploads content"| node_cloud_storage

click node_api "https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py"
click node_normalization "https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py"
click node_matchers "https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py"
click node_matcher_models "https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/data_models.py"
click node_fuzzy "https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py"
click node_scanner_demo "https://github.com/mikemoore63/spdx_matcher/blob/main/demo.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_matcher_models,node_results toneIndigo
class node_api toneMint
class node_normalization,node_matchers,node_fuzzy,node_scanner_demo toneTeal
class node_filesystem,node_cloud_storage toneAmber
```

## Components

### Other components

- **Library caller**
- [Matcher API](https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py): `src/spdx_matcher/__init__.py`
- [Text normalization](https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py): `src/spdx_matcher/__init__.py`
- [License matching](https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py): `src/spdx_matcher/__init__.py`
- [Matcher models](https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/data_models.py): `src/spdx_matcher/data_models.py`
- [Fuzzy matching](https://github.com/mikemoore63/spdx_matcher/blob/main/src/spdx_matcher/__init__.py): `src/spdx_matcher/__init__.py`
- **Match results**
- [Filesystem scanner demo](https://github.com/mikemoore63/spdx_matcher/blob/main/demo.py): `demo.py`
- **Local files**
- **Google Cloud Storage**

## Connections

- Library caller → Matcher API: submits text (evidence: `README.md`)
- Matcher API → Text normalization: normalizes text (evidence: `README.md`)
- Matcher API → License matching: matches license (evidence: `README.md`)
- License matching → Match results: returns details (evidence: `README.md`)
- Library caller → Fuzzy matching: requests fuzzy match (evidence: `README.md`)
- Fuzzy matching → Match results: returns scores (evidence: `README.md`)
- Matcher API → Matcher models: imports models (evidence: `src/spdx_matcher/__init__.py`)
- Filesystem scanner demo → Local files: reads files (evidence: `demo.py`)
- Filesystem scanner demo → Matcher API: calls matcher (evidence: `demo.py`)
- Filesystem scanner demo → Google Cloud Storage: uploads content (evidence: `demo.py`)
