# ruyanga/ai-experts-assignment-python- architecture

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

- Interactive diagram: https://gitdiagram.com/ruyanga/ai-experts-assignment-python-
- Repository: https://github.com/ruyanga/ai-experts-assignment-python-

## Overview

This is a small Python assignment repository whose runtime code provides an HTTP request client with OAuth2 authorization-header handling and token parsing. The main workflow is a caller invoking Client.request; API requests refresh a missing or expired token and add its bearer header before preparing the request. Token expiry and header formatting live in OAuth2Token, while token_from_iso converts an ISO timestamp into that model. The README focuses on running tests and fixing a bug, not on a broader product. The caller relationship is not shown in the sampled source, so it is left unconnected.

Main entry points: [`app/tokens.py`](https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/tokens.py) (OAuth2 Token), [`app/http_client.py`](https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/http_client.py) (HTTP Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_caller(("Caller"))
node_client["HTTP Client<br/>[http_client.py]"]
node_token["OAuth2 Token<br/>[tokens.py]"]
node_token_parser["ISO Token Parser<br/>[tokens.py]"]

node_client -->|"refreshes and formats"| node_token
node_token_parser -->|"constructs"| node_token

click node_client "https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/http_client.py"
click node_token "https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/tokens.py"
click node_token_parser "https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/tokens.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_caller toneIndigo
class node_client toneBlue
class node_token,node_token_parser toneTeal
```

## Components

### Other components

- **Caller**
- [HTTP Client](https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/http_client.py): `app/http_client.py`
- [OAuth2 Token](https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/tokens.py): `app/tokens.py`
- [ISO Token Parser](https://github.com/ruyanga/ai-experts-assignment-python-/blob/main/app/tokens.py): `app/tokens.py`

## Connections

- HTTP Client → OAuth2 Token: refreshes and formats (evidence: `app/http_client.py`)
- ISO Token Parser → OAuth2 Token: constructs (evidence: `app/tokens.py`)
