From e492db40d23fad88451eea7f7871d77f24edfde4 Mon Sep 17 00:00:00 2001 From: ai7s1 Date: Thu, 15 Jan 2026 08:39:04 +0000 Subject: [PATCH] Initial commit --- .DS_Store | Bin 0 -> 6148 bytes ...base Search System _ Beginner's Guide.html | 740 ++++++++++++++++++ scheduler_bots/.DS_Store | Bin 0 -> 6148 bytes scheduler_bots/README.md | 60 ++ scheduler_bots/requirements.txt | 13 + scheduler_bots/schedule_template RS.csv | 11 + scheduler_bots/telegram_scheduler_v2.py | 196 +++++ school_search.py | 0 ...деление по группам Технолицей 2025_2026 - 4.csv | 111 +++ 9 files changed, 1131 insertions(+) create mode 100644 .DS_Store create mode 100644 Student Database Search System _ Beginner's Guide.html create mode 100644 scheduler_bots/.DS_Store create mode 100644 scheduler_bots/README.md create mode 100644 scheduler_bots/requirements.txt create mode 100644 scheduler_bots/schedule_template RS.csv create mode 100644 scheduler_bots/telegram_scheduler_v2.py create mode 100644 school_search.py create mode 100644 Распределение по группам Технолицей 2025_2026 - 4.csv diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..584ee46a92f48ae9fd9f7be7e8d204e48614ef42 GIT binary patch literal 6148 zcmeHK!AiqG5S?wSZ750)3VK`cS}?H+f|pS14_MKIN==$VgE3p0lpabUcl{xM#P4xt zcPo~v2M;1;24>&v>`XTMHtb{pK(r^32hae38Y*GQ!R8C0ancnjSr4Jm&xl|G2@GHi zy_INo{6_|8@3tX>J`8c+KJQ-$3UbK8X*LQI6=K|LI7;FycilHpDpxi(t5v63uikfu zYTC_%e3G?;@h$bPluE*d9fa5MVA^Z!oU1es;&d?932`*Qkh_~WjnuTQCTW!E+^!jL zoSM^X?9XPN*J?`d*qt}!%sV=DoATteHJ>}R-Gjrk%id%1l&WXLtiX>@%a+9jyrA*p zBBQLIg!s~n1V(0n8DIw1n*n=V*6QoMOkN!`zzqC?0XiQfDxq(&FsP3XZ0Prq#w&y* zXwzMSP+IgY76x$yMVM4XlPc^LLzr~*OB?4~EDV}-5PD{Oj-6T98;a1gqhIQ95WYcf znE_^CnSrwDHmLqze1HF6PU0RjzznPv1ESLDcG|ckTU%EaN3~X>KA@6NTw(Ad1r1$_ gF_ud49;z1fOEM6Bi-ke-pzx1?rhyw~;7=KN2hgTbN&o-= literal 0 HcmV?d00001 diff --git a/Student Database Search System _ Beginner's Guide.html b/Student Database Search System _ Beginner's Guide.html new file mode 100644 index 0000000..630ffbb --- /dev/null +++ b/Student Database Search System _ Beginner's Guide.html @@ -0,0 +1,740 @@ + + + + + + Student Database Search System | Beginner's Guide + + + + +
+ +
+
+
+

Student Database Search System

+

From Excel to Database - A Beginner's Journey

+
+ +
+

Goal: Build a working search system in 1 hour

+

Prerequisites: No database experience needed!

+
+
+
+ + +
+

What Is a Relational Database?

+

Beginner's Guide to Understanding Database Fundamentals

+ +
+

You'll Learn:

+
+
1
+
What tables, fields, records, and keys are
+
+ +
+
2
+
How relationships connect data across tables
+
+ +
+
3
+
Why primary keys and foreign keys are critical
+
+ +
+
4
+
The role of SQL (Structured Query Language)
+
+ +
+
5
+
Real-world examples in banks, hospitals, and apps
+
+
+ +
+ Think of it like this: +

A relational database is like a digital filing cabinet with labeled folders (tables) that are connected to each other.

+

Each folder contains specific information that can be linked to other folders.

+
+
+ + +
+

Let's Watch and Learn

+

Take 10 minutes to understand relational databases

+ +
+

What Is a Relational Database? | Beginner's Guide

+

By Knewget (30.3K subscribers)

+ + + ▶ Watch Video on YouTube + + +

+ This video explains everything you need to know about databases in plain English. + Perfect for beginners! +

+
+ +
+

Key Takeaways:

+
+
+
Tables = Excel sheets with rows and columns
+
+ +
+
+
Rows = Individual records (like a student)
+
+ +
+
+
Columns = Fields of information (name, grade, etc.)
+
+ +
+
+
Primary Key = Unique ID for each row
+
+ +
+
+
Foreign Key = Link to another table
+
+
+
+ + +
+

Our 1-Hour MVP Project

+

Simple Python program to search student schedules

+ +
+ Current Problem: +

School data is in messy Excel sheets that are hard to search.

+

We need to find information quickly!

+
+ +

Search Examples We'll Build:

+
+
+
1
+
+ Find homeroom teacher:
+ "Who is the homeroom teacher for student Alex?" +
+
+ +
+
2
+
+ Find students in a subject:
+ "Show me all students in Math class 4A" +
+
+ +
+
3
+
+ Simple database search:
+ "Search for any information across all sheets" +
+
+
+
+ + +
+

Step 1: Setup (5 minutes)

+ +
# 1. Create a new file called "school_search.py" +# 2. Open it in any text editor +# 3. Start with this basic setup: + +import pandas as pd + +def main(): + # Main function - everything starts here + print("=== School Search System ===") + + # Load our Excel file + file_path = "school_data.xlsx" + + try: + # Read the Excel file + excel_file = pd.ExcelFile(file_path) + print(f"Success! Found {len(excel_file.sheet_names)} sheets") + return excel_file + except Exception as e: + print(f"Error: {e}") + return None + +if __name__ == "__main__": + main()
+ +
+

To Install Required Libraries:

+
# Open Command Prompt or Terminal and type: +pip install pandas
+

That's it! Pandas will help us read Excel files easily.

+
+
+ + +
+

Step 2: Create Search Function (15 minutes)

+ +
# Add this function to your file (under the imports) + +def simple_search(excel_file, search_term): + """Search for any term across all sheets""" + results = [] + + for sheet_name in excel_file.sheet_names: + # Read each sheet + df = pd.read_excel(excel_file, sheet_name=sheet_name) + + # Search in all cells + for row_idx, row in df.iterrows(): + for col_name, cell_value in row.items(): + if pd.notna(cell_value): + if search_term.lower() in str(cell_value).lower(): + results.append({ + 'sheet': sheet_name, + 'row': row_idx + 2, # Excel row number + 'column': col_name, + 'value': str(cell_value) + }) + + return results
+ +

Update Your Main Function:

+
def main(): + print("=== School Search System ===") + + # Load data + data = pd.ExcelFile("school_data.xlsx") + + # Test search + print("\nSearching for 'Math'...") + math_results = simple_search(data, "Math") + + for result in math_results[:5]: # Show first 5 results + print(f"Found in {result['sheet']}, row {result['row']}: {result['value']}") + + print(f"\nTotal found: {len(math_results)} results")
+
+ + +
+

Step 3: Add Specific Searches (15 minutes)

+ +
# Function to find homeroom teacher +def find_teacher(excel_file, student_name): + """Find homeroom teacher for a student""" + + for sheet_name in excel_file.sheet_names: + df = pd.read_excel(excel_file, sheet_name=sheet_name) + + # Look for student name + for idx, row in df.iterrows(): + for cell_value in row.values: + if pd.notna(cell_value) and student_name in str(cell_value): + # Check if teacher info is in same row + for col in df.columns: + if "teacher" in str(col).lower() or "преподаватель" in str(col).lower(): + if pd.notna(row[col]): + return row[col] + + return "Teacher not found"
+ +
# Function to find students by class +def find_students_in_class(excel_file, class_name): + """Find all students in a specific class (like 4A)""" + students = [] + + for sheet_name in excel_file.sheet_names: + df = pd.read_excel(excel_file, sheet_name=sheet_name) + + for idx, row in df.iterrows(): + for cell_value in row.values: + if pd.notna(cell_value) and class_name in str(cell_value): + # Look for student names in this row + for col in df.columns: + if "name" in str(col).lower() or "фио" in str(col).lower(): + if pd.notna(row[col]): + students.append(row[col]) + + return list(set(students)) # Remove duplicates
+
+ + +
+

Step 4: Complete Program (10 minutes)

+ +
# school_search.py - COMPLETE PROGRAM + +import pandas as pd + +# [PASTE ALL FUNCTIONS FROM PREVIOUS SLIDES HERE] +# 1. simple_search() function +# 2. find_teacher() function +# 3. find_students_in_class() function + +def main(): + # 1. Load the data + print("=== Student Database Search ===") + + try: + # Change this to your actual file name + data = pd.ExcelFile("Распределение по группам Технолицей 2025_2026 - 4.xlsx") + print(f"✓ Loaded: {len(data.sheet_names)} sheets") + except: + print("✗ Error: Make sure the Excel file is in the same folder!") + return + + # 2. Example searches + print("\n--- Example 1: Find Teacher ---") + teacher = find_teacher(data, "Арефьев") + print(f"Homeroom teacher: {teacher}") + + print("\n--- Example 2: Find Students ---") + students = find_students_in_class(data, "4A") + print(f"Students in 4A: {len(students)} found") + for student in students[:3]: # Show first 3 + print(f" • {student}") + + print("\n--- Example 3: General Search ---") + results = simple_search(data, "Math") + print(f"Found 'Math' {len(results)} times") + + print("\n=== Search Complete ===") + +if __name__ == "__main__": + main()
+ +
+

How to Run:

+
+
1
+
Save all code in "school_search.py"
+
+ +
+
2
+
Put your Excel file in same folder
+
+ +
+
3
+
Open terminal in that folder
+
+ +
+
4
+
Type: python school_search.py
+
+
+
+ + +
+

Next Step: Real Database

+

Moving from Excel to SQLite database

+ +
# Simple SQLite database setup (future enhancement) +import sqlite3 + +def create_database(): + # Connect to database (creates if doesn't exist) + conn = sqlite3.connect('school.db') + cursor = conn.cursor() + + # Create tables (like in the video!) + cursor.execute('''CREATE TABLE IF NOT EXISTS students ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + grade TEXT, + class TEXT, + homeroom_teacher_id INTEGER + )''') + + cursor.execute('''CREATE TABLE IF NOT EXISTS teachers ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + subject TEXT + )''') + + conn.commit() + conn.close() + print("Database created successfully!")
+ +
+ Database vs Excel: +

Excel: Good for viewing, bad for searching

+

Database: Fast searching, relationships, scalable

+
+ +
+

Your 1-Hour MVP is Complete!

+

You've built a working search system that can:

+

• Search across all Excel sheets

+

• Find teachers for students

+

• List students in classes

+

• Be extended to a real database

+
+
+ + + +
+ + + + \ No newline at end of file diff --git a/scheduler_bots/.DS_Store b/scheduler_bots/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..661d402ba514ca403abbc1f43cc8a5fd73fdeeec GIT binary patch literal 6148 zcmeH~JqiLr422WjLa^D=avBfd4F=H@cmeUJ6D>sRIl3=D2(H#5@&d^>$xK-G6+0Ud z(dF&15a~r^0yoOs!oU=HCwDo@S?-7H{SKu2 zy&Wuht|nVB+C_8t(0sDm6a&*}7cEF&S{)2jfC>y07)RdQ{lA8Pn*RqaOsN1B_%j8x zTWwZLyj0$;Z?9+dZB}jF;GiEzc=-uHVps7D?uPwh3$P|z5EU4I1Y8CND)3bW9)AK7 A!T