English | 简体中文
- Introduction
- Demo
- Key Features
- Requirements
- Installation
- Usage
- Renaming Rules
- Excel List Requirements
- Important Notes
- Changelog
- FAQ
RName is a student assignment batch renaming tool designed for teachers. It automatically standardizes assignment filenames based on an Excel roster and tracks submission status.
Author: Leo (geneleo@qq.com)
Version: v1.3.12
Updated: 2023.03.24
Created: 2021.12.28
-
Batch Renaming - Standardized bulk renaming for files and folders
- Customizable naming format (serial number, student ID, name, class, etc.)
- Format example:
017.2022030432.ZhangJia.22CS1.docx
-
Intelligent Matching - Smart assignment matching based on Excel roster
- Primary matching via student names (automatic Traditional/Simplified Chinese conversion)
- Duplicate names distinguished by student ID
- Auto-recognition of international student markers (
*) and various suffixes
-
Duplicate Detection - Detects duplicate submissions with detailed alerts
- Prevents overwriting errors
- Provides detailed duplicate submission list
-
Statistics - Automatic submission tracking
- Generates list of students who haven't submitted
- Auto-writes submission status to Excel (submitted=1, not submitted=0)
- Supports multiple assignment tracking (Submission1, Submission2...)
- ✅ Auto conversion: Traditional to Simplified Chinese (using OpenCC)
- ✅ Recognition and handling of international student markers (
*) - ✅ Auto-removal of common suffixes:
(Online),(Makeup),(Retake), etc. - ✅ Auto-numbering for duplicate names:
ZhangSan1,ZhangSan2 - ✅ Support for folders as submissions (no extension)
- OS: Windows 10/11
- Python: 3.11 or higher
- Microsoft Excel: Required (dependency for xlwings)
-
Install Python
Download and install the latest version from Python Official Website
-
Install Dependencies
Open Command Prompt (CMD) or PowerShell and run:
pip install xlwings opencc
- xlwings: For reading/writing Excel files
- opencc: For Traditional/Simplified Chinese conversion
-
Run the Program
Double-click
RName.pyor run in command line:python RName.py
-
Specify Assignment Folder
Click "Specify Directory" button to select the folder containing student assignments
-
Specify Excel Roster
Click "Specify Roster" button to select the Excel file with student information
-
Configure Renaming Rules (Optional)
- Check/uncheck required fields (serial number, student ID, name)
- Set prefixes and suffixes
- Specify file extension (leave empty to keep original)
- Class position (1-8, leave empty to exclude class)
-
Start Renaming
Click "Start Renaming" button to execute
Based on configured settings, generated filenames look like:
017.2022030432.ZhangJia.docx(Serial + Student ID + Name)001.22CS1.LiSi.pdf(Serial + Class + Name)ZhangSan.International.pptx(Name only with international marker)
The renaming format consists of the following fields (optional):
| Order | Field | Description | Example |
|---|---|---|---|
| 1 | Prefix1 | Custom prefix | - |
| 2 | Serial | 3-digit number, range: 001-999 | 017 |
| 3 | Prefix2 | Separator (default: .) |
. |
| 4 | Student ID | Read from Excel | 2022030432 |
| 5 | Prefix3 | Separator (default: .) |
. |
| 6 | Name | Read from Excel (Required) | ZhangJia |
| 7 | Suffix | Custom suffix | .Homework |
| Extra | Class | Can be inserted before positions 1-8 | 22CS1 |
| 8 | Extension | File extension | .docx |
Note:
- Name field is required (always checked)
- Folders submitted as assignments have no extension
- Spaces in filenames are automatically removed
| Column | Name | Required | Description |
|---|---|---|---|
| Column A | Student ID | ✅ Required | Must be numeric, no duplicates |
| Column B | Name | ✅ Required | Supports Traditional/Simplified, can have * marker |
| Column C | Class | ❌ Optional | Read when needed |
| Column D+ | Submission Stats | - | Auto-written by program |
-
Sheet
- Uses the first sheet by default
- Sheet name can be specified in the interface
-
Rows
- Row 1 is the header row
- Data starts from row 2 to the last row
-
Columns
- Data must start from column 1 (Column A)
- Can contain 2 columns (Student ID + Name) or 3 columns (Student ID + Name + Class)
-
Data Writing
- Statistics start from column 4 (Column D)
- If D is occupied, automatically finds the next empty column
- Column header format:
Submission1,Submission2... - Data format: Submitted=
1, Not Submitted=0
| Student ID | Name | Class | Submission1 | Submission2 |
|------------|---------------|----------|-------------|-------------|
| 2022030432 | Zhang San | 22CS1 | 1 | 1 |
| 2022030433 | Li Si* | 22CS1 | 0 | 1 |
| 2022030434 | Wang Wu(Makeup)| 22CS2 | 1 | 0 |
-
Name Matching Priority
The program matches based on "name" in filenames (students rarely misspell their names):
- ✅ Filename must contain the student's correct name
- ❌ Files without names or with incorrect names cannot be renamed
-
Duplicate Name Handling
For duplicate names, the filename must include the correct student ID:
- When multiple students share the same name (e.g., "Zhang San"), distinction is made via student ID
- Filename example:
ZhangSan-2022030432-Assignment1.docx
-
File Hierarchy Limitation
- ✅ Only processes first-level files/folders in the specified directory
- ❌ Does not recurse into subdirectories (second-level)
-
Special Character Processing
- ✅
*before/after names is recognized as international student marker - ✅ Auto-removes suffixes:
(Online),(Makeup),(Retake),(Transfer),(Advanced),(Minor), etc. - ❌ Ethnic minority marker
△cannot be automatically recognized and must be removed manually
- ✅
-
File Status
- Ensure files to be renamed are not open (especially Word, Excel, etc.)
- Ensure Excel roster file is not occupied by other programs
-
Data Validation
- Student IDs in Excel must be numeric (convertible to integer)
- Student IDs cannot be duplicated
- Student ID and Name columns must have the same number of entries
Environment: Python 3.11.1, Windows 10/11
- 🐛 Fix: Student ID data type validation, pre-check if student ID is numeric
- 🐛 Fix: Unable to process suffixes like "(Online)"
Environment: Python 3.11.1, Windows 11
- ✨ Improve: Excel column header changed from "Assignment n" to "Submission n"
- ✨ Improve: Optimized print information display
Environment: Python 3.11.1, Windows 11
- 🐛 Fix:
dupnamedictionary undefined error due to commenting - 🐛 Fix: Type conversion issue when finding student ID for duplicate names
- 🐛 Fix: Dialog display issue when icon file doesn't exist
Environment: Python 3.10.4, Windows 10
- 🐛 Fix: String concatenation error due to non-text format in Excel student ID column
- 🐛 Fix: Issue with student ID having
.0suffix (float to int to str conversion) - ✨ Improve: Support for multiple bracket suffixes, e.g.,
(Transfer)(Online) - ✨ Improve: Uses default icon when icon file is missing, no error
- ✨ Improve: Default serial number changed to 3 digits
- ✨ Improve: Default renaming excludes class
A: Ensure dependencies are installed:
pip install xlwings openccA: Close all open Excel files (including roster file), then retry.
A:
- Ensure student ID column is numeric (convertible to integer)
- Check for duplicate student IDs
- Student ID cannot contain text or special characters
A: Possible reasons:
- Filename doesn't contain student name
- Duplicate names but student ID in filename is incorrect or missing
- File is occupied by another program
A: The program currently cannot auto-recognize △ marker. It must be manually removed from the Excel roster.
A: Due to dependency on xlwings library (requires Microsoft Excel), currently only Windows is supported.
- Data pre-check: Validate name, student ID, class format before execution
- Improve error handling: Prevent data errors from causing filename loss
- Support more special suffix recognition (e.g.,
△ethnic minority marker) - Add logging: Record renaming history
- Support undo: Recover from incorrect renaming
- Cross-platform support: Consider alternative Excel libraries for macOS and Linux
This project is licensed under the MIT License. See LICENSE file for details.
Leo
- Email: geneleo@qq.com
- Created: 2021.12.28
Thanks to the following open source projects:
If this tool helps you, feel free to Star ⭐
