# atacanymc/yargitay-karar-scraper architecture

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

- Interactive diagram: https://gitdiagram.com/atacanymc/yargitay-karar-scraper
- Repository: https://github.com/atacanymc/yargitay-karar-scraper

## Overview

Yargıtay Karar Scraper exposes legal-decision search and full-text retrieval through a Python client, a terminal CLI, and an MCP server. Users submit simple or detailed search criteria; the scraper queries Yargıtay and returns structured results, which can then be used to request and read a cleaned decision text. The graph separates the entry points, search/retrieval logic, and data models. Source excerpts establish the internal calls; the README documents the MCP and library use cases.

Main entry points: [`yargitay_karar_scraper/scraper/client.py`](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/client.py) (Search and retrieval client), [`yargitay_karar_scraper/cli/main.py`](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/cli/main.py) (CLI commands), [`yargitay_karar_scraper/mcp/server.py`](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/mcp/server.py) (MCP tools), [`yargitay_karar_scraper/scraper/models.py`](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/models.py) (Criteria and responses)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI commands<br/>[main.py]"]
  node_mcp["MCP tools<br/>[server.py]"]
end

subgraph group_scraper["Scraper runtime"]
  node_client["Search and retrieval client<br/>[client.py]"]
  node_cleaner["Decision text cleaning<br/>[client.py]"]
end

subgraph group_domain["Search data"]
  node_models["Criteria and responses<br/>[models.py]"]
end

node_user(("CLI user"))
node_mcp_host(("MCP host / LLM"))
node_yargitay["Yargıtay search site"]

node_user -->|"runs commands"| node_cli
node_mcp_host -->|"calls tools"| node_mcp
node_cli -->|"builds criteria"| node_models
node_cli -->|"requests searches"| node_client
node_cli -->|"requests details"| node_client
node_mcp -->|"builds criteria"| node_models
node_mcp -->|"requests searches"| node_client
node_mcp -->|"requests details"| node_client
node_client -->|"uses and returns"| node_models
node_client -->|"sends search and detail requests"| node_yargitay
node_client -->|"cleans document text"| node_cleaner

click node_cli "https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/cli/main.py"
click node_mcp "https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/mcp/server.py"
click node_client "https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/client.py"
click node_cleaner "https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/client.py"
click node_models "https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/models.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_cli,node_mcp,node_user toneBlue
class node_client,node_cleaner toneAmber
class node_models toneMint
class node_mcp_host,node_yargitay toneIndigo
```

## Components

### User interfaces

- [CLI commands](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/cli/main.py): `yargitay_karar_scraper/cli/main.py`
- [MCP tools](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/mcp/server.py): `yargitay_karar_scraper/mcp/server.py`

### Scraper runtime

- [Search and retrieval client](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/client.py): `yargitay_karar_scraper/scraper/client.py`
- [Decision text cleaning](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/client.py): `yargitay_karar_scraper/scraper/client.py`

### Search data

- [Criteria and responses](https://github.com/atacanymc/yargitay-karar-scraper/blob/main/yargitay_karar_scraper/scraper/models.py): `yargitay_karar_scraper/scraper/models.py`

### Other components

- **CLI user**
- **MCP host / LLM**
- **Yargıtay search site**

## Connections

- CLI user → CLI commands: runs commands (evidence: `README.md`)
- MCP host / LLM → MCP tools: calls tools (evidence: `README.md`)
- CLI commands → Criteria and responses: builds criteria (evidence: `yargitay_karar_scraper/cli/main.py`)
- CLI commands → Search and retrieval client: requests searches (evidence: `yargitay_karar_scraper/cli/main.py`)
- CLI commands → Search and retrieval client: requests details (evidence: `yargitay_karar_scraper/cli/main.py`)
- MCP tools → Criteria and responses: builds criteria (evidence: `yargitay_karar_scraper/mcp/server.py`)
- MCP tools → Search and retrieval client: requests searches (evidence: `yargitay_karar_scraper/mcp/server.py`)
- MCP tools → Search and retrieval client: requests details (evidence: `yargitay_karar_scraper/mcp/server.py`)
- Search and retrieval client → Criteria and responses: uses and returns (evidence: `yargitay_karar_scraper/scraper/client.py`)
- Search and retrieval client → Yargıtay search site: sends search and detail requests (evidence: `yargitay_karar_scraper/scraper/client.py`)
- Search and retrieval client → Decision text cleaning: cleans document text (evidence: `yargitay_karar_scraper/scraper/client.py`)
