# xianzs/pythonlearning architecture

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

- Interactive diagram: https://gitdiagram.com/xianzs/pythonlearning
- Repository: https://github.com/xianzs/pythonlearning

## Overview

PythonLearning-2026 is a teaching repository, not one integrated runtime system: it organizes Python lessons from fundamentals through advanced topics and the standard library, with demos and practical projects. The principal learner workflow is to follow the documented learning route and use each section’s examples to build understanding; the sampled chat assistant is a separate end-to-end project, from Streamlit input and settings through session history and streamed DeepSeek responses to rendered messages. The assistant links below follow shown imports and calls; broader curriculum links reflect the README’s documented order and capabilities.

Main entry points: [`python_practical_project/Intelligent_Chat_Programming_Assistant/app.py`](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/app.py) (Streamlit Entry), [`python_practical_project/Intelligent_Chat_Programming_Assistant/src/chat_manager.py`](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/chat_manager.py) (Conversation State), [`python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/sidebar.py`](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/sidebar.py) (Settings Sidebar), [`python_practical_project/Intelligent_Chat_Programming_Assistant/src/deepseek_client.py`](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/deepseek_client.py) (DeepSeek Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["Python Foundations"]
  node_basics["Python Basics"]
  node_fundamentals["Core Syntax"]
  node_files["File Handling<br/>[6_file_operate.py]"]
end

subgraph group_advanced["Advanced Python"]
  node_advanced_topics["Advanced Topics"]
  node_functions["Advanced Functions"]
  node_oop["Object Oriented<br/>[3_oop_code.py]"]
  node_networking["Network Programming"]
  node_databases["Database Programming"]
end

subgraph group_stdlib["Standard Library"]
  node_stdlib["Standard Library"]
  node_data_formats["Data Formats"]
  node_concurrency["Concurrency"]
  node_stdlib_network["Network Modules"]
  node_security["Security Modules"]
end

subgraph group_demos["Learning Demos"]
  node_demos["Python Demos"]
  node_monitor["System Monitor"]
  node_image_demo["Terminal Images<br/>[main.py]"]
end

subgraph group_assistant["Chat Assistant"]
  node_app["Streamlit Entry<br/>[app.py]"]
  node_sidebar["Settings Sidebar<br/>[sidebar.py]"]
  node_chat_ui["Chat Display<br/>[chat_area.py]"]
  node_chat_state["Conversation State<br/>[chat_manager.py]"]
  node_config["Model Configuration<br/>[config.py]"]
  node_stream["Stream Processor<br/>[stream_handler.py]"]
  node_client["DeepSeek Client<br/>[deepseek_client.py]"]
end

node_learner(("Learner"))
node_app_user(("Chat User"))
node_deepseek{{"DeepSeek API"}}

node_learner -->|"learns first"| node_basics
node_basics -->|"continues to"| node_advanced_topics
node_advanced_topics -->|"continues to"| node_stdlib
node_stdlib -->|"explores optional"| node_demos
node_app_user -->|"submits prompt"| node_app
node_app -->|"renders settings"| node_sidebar
node_app -->|"renders messages"| node_chat_ui
node_app -->|"manages history"| node_chat_state
node_app -->|"processes response"| node_stream
node_sidebar -->|"reads settings"| node_config
node_sidebar -->|"manages session"| node_chat_state
node_chat_ui -->|"reads history"| node_chat_state
node_chat_state -->|"uses limits"| node_config
node_stream -->|"consumes chunks"| node_client
node_client -->|"uses API settings"| node_config
node_client -->|"requests stream"| node_deepseek

click node_basics "https://github.com/xianzs/pythonlearning/tree/main/python_basic_learning"
click node_fundamentals "https://github.com/xianzs/pythonlearning/blob/main/python_basic_learning/1_Variables_and_Data_Types.py"
click node_files "https://github.com/xianzs/pythonlearning/blob/main/python_basic_learning/6_file_operate.py"
click node_advanced_topics "https://github.com/xianzs/pythonlearning/tree/main/python_advance_learning"
click node_functions "https://github.com/xianzs/pythonlearning/blob/main/python_advance_learning/2_advance_func/2_advance_function.py"
click node_oop "https://github.com/xianzs/pythonlearning/blob/main/python_advance_learning/3_oop_code/3_oop_code.py"
click node_networking "https://github.com/xianzs/pythonlearning/tree/main/python_advance_learning/6_web_code"
click node_databases "https://github.com/xianzs/pythonlearning/tree/main/python_advance_learning/7_sql_code"
click node_stdlib "https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning"
click node_data_formats "https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/2_data_process_format"
click node_concurrency "https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/7_concurrency_and_asynchrony"
click node_stdlib_network "https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/9_network_communication"
click node_security "https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/10_encryption_and_security"
click node_demos "https://github.com/xianzs/pythonlearning/tree/main/python_Demo_learning"
click node_monitor "https://github.com/xianzs/pythonlearning/blob/main/python_Demo_learning/1_real_time_system_monitoring_panel/3_real_time_dashboard.py"
click node_image_demo "https://github.com/xianzs/pythonlearning/blob/main/python_Demo_learning/2_picture_show/main.py"
click node_app "https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/app.py"
click node_sidebar "https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/sidebar.py"
click node_chat_ui "https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/chat_area.py"
click node_chat_state "https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/chat_manager.py"
click node_config "https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/config.py"
click node_stream "https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/stream_handler.py"
click node_client "https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/deepseek_client.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_basics,node_fundamentals,node_files,node_app_user toneBlue
class node_advanced_topics,node_functions,node_oop,node_networking,node_databases toneAmber
class node_stdlib,node_data_formats,node_concurrency,node_stdlib_network,node_security,node_deepseek toneMint
class node_demos,node_monitor,node_image_demo toneRose
class node_app,node_sidebar,node_chat_ui,node_chat_state,node_config,node_stream,node_client,node_learner toneIndigo
```

## Components

### Python Foundations

- [Python Basics](https://github.com/xianzs/pythonlearning/tree/main/python_basic_learning): `python_basic_learning`
- [Core Syntax](https://github.com/xianzs/pythonlearning/blob/main/python_basic_learning/1_Variables_and_Data_Types.py): `python_basic_learning/1_Variables_and_Data_Types.py`
- [File Handling](https://github.com/xianzs/pythonlearning/blob/main/python_basic_learning/6_file_operate.py): `python_basic_learning/6_file_operate.py`

### Advanced Python

- [Advanced Topics](https://github.com/xianzs/pythonlearning/tree/main/python_advance_learning): `python_advance_learning`
- [Advanced Functions](https://github.com/xianzs/pythonlearning/blob/main/python_advance_learning/2_advance_func/2_advance_function.py): `python_advance_learning/2_advance_func/2_advance_function.py`
- [Object Oriented](https://github.com/xianzs/pythonlearning/blob/main/python_advance_learning/3_oop_code/3_oop_code.py): `python_advance_learning/3_oop_code/3_oop_code.py`
- [Network Programming](https://github.com/xianzs/pythonlearning/tree/main/python_advance_learning/6_web_code): `python_advance_learning/6_web_code`
- [Database Programming](https://github.com/xianzs/pythonlearning/tree/main/python_advance_learning/7_sql_code): `python_advance_learning/7_sql_code`

### Standard Library

- [Standard Library](https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning): `python_stdlib_learning`
- [Data Formats](https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/2_data_process_format): `python_stdlib_learning/2_data_process_format`
- [Concurrency](https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/7_concurrency_and_asynchrony): `python_stdlib_learning/7_concurrency_and_asynchrony`
- [Network Modules](https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/9_network_communication): `python_stdlib_learning/9_network_communication`
- [Security Modules](https://github.com/xianzs/pythonlearning/tree/main/python_stdlib_learning/10_encryption_and_security): `python_stdlib_learning/10_encryption_and_security`

### Learning Demos

- [Python Demos](https://github.com/xianzs/pythonlearning/tree/main/python_Demo_learning): `python_Demo_learning`
- [System Monitor](https://github.com/xianzs/pythonlearning/blob/main/python_Demo_learning/1_real_time_system_monitoring_panel/3_real_time_dashboard.py): `python_Demo_learning/1_real_time_system_monitoring_panel/3_real_time_dashboard.py`
- [Terminal Images](https://github.com/xianzs/pythonlearning/blob/main/python_Demo_learning/2_picture_show/main.py): `python_Demo_learning/2_picture_show/main.py`

### Chat Assistant

- [Streamlit Entry](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/app.py): `python_practical_project/Intelligent_Chat_Programming_Assistant/app.py`
- [Settings Sidebar](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/sidebar.py): `python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/sidebar.py`
- [Chat Display](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/chat_area.py): `python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/chat_area.py`
- [Conversation State](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/chat_manager.py): `python_practical_project/Intelligent_Chat_Programming_Assistant/src/chat_manager.py`
- [Model Configuration](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/config.py): `python_practical_project/Intelligent_Chat_Programming_Assistant/src/config.py`
- [Stream Processor](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/stream_handler.py): `python_practical_project/Intelligent_Chat_Programming_Assistant/src/stream_handler.py`
- [DeepSeek Client](https://github.com/xianzs/pythonlearning/blob/main/python_practical_project/Intelligent_Chat_Programming_Assistant/src/deepseek_client.py): `python_practical_project/Intelligent_Chat_Programming_Assistant/src/deepseek_client.py`

### Other components

- **Learner**
- **Chat User**
- **DeepSeek API**

## Connections

- Learner → Python Basics: learns first (evidence: `README.md`)
- Python Basics → Advanced Topics: continues to (evidence: `README.md`)
- Advanced Topics → Standard Library: continues to (evidence: `README.md`)
- Standard Library → Python Demos: explores optional (evidence: `README.md`)
- Chat User → Streamlit Entry: submits prompt (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/app.py`)
- Streamlit Entry → Settings Sidebar: renders settings (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/app.py`)
- Streamlit Entry → Chat Display: renders messages (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/app.py`)
- Streamlit Entry → Conversation State: manages history (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/app.py`)
- Streamlit Entry → Stream Processor: processes response (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/app.py`)
- Settings Sidebar → Model Configuration: reads settings (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/sidebar.py`)
- Settings Sidebar → Conversation State: manages session (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/sidebar.py`)
- Chat Display → Conversation State: reads history (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/src/ui/chat_area.py`)
- Conversation State → Model Configuration: uses limits (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/src/chat_manager.py`)
- Stream Processor → DeepSeek Client: consumes chunks (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/src/stream_handler.py`)
- DeepSeek Client → Model Configuration: uses API settings (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/src/deepseek_client.py`)
- DeepSeek Client → DeepSeek API: requests stream (evidence: `python_practical_project/Intelligent_Chat_Programming_Assistant/src/deepseek_client.py`)
