calculate
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "calculate" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-f21603a743bd2dc643c94c58af4b8c8bb608b0a67255716fbd2707f6bb8b3f34. Verify the upstream source and version against https://skillhub.cn/skills/user_ebf2de1c/calculate before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Skill for calculating attendance work hours, used to automatically compute each person’s daily working hours from clock-in records and insert summary rows. Applicable when a user has clock-in records in Excel and needs rule-based attendance reports and overtime statistics. Example trigger words: attendance, clock-in, hours calculation, attendance report, calculate hours, attendance statistics, overtime calculation.
Introduction source: third_party · user_ebf2de1c · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: 算考勤
description: >-
计算考勤工时。适用场景:用户有一份打卡记录Excel表,需要按规则自动计算每人每日工作时长并插入汇总行。
触发词包括:考勤、打卡、工时计算、考勤报表、算工时、出勤统计、加班计算。
agent_created: true考勤工时计算器
概述
从打卡记录Excel表中自动计算每人每日工作时长,按公司考勤规则核算上午/下午/加班工时,并在每人下方插入"当天时长"汇总行。
执行流程
1. 读取原始考勤表
使用 openpyxl 加载用户提供的 xlsx 文件,确认:
- 人员数据从第5行开始
- 列A为姓名,列G(第7列)起为每日打卡记录,日期列由脚本自动从第4行表头识别
- 打卡记录格式示例:
07:36外勤\n11:04 \n12:25 \n21:04
2. 运行计算脚本
执行打包的 scripts/calculate_attendance.py,传入输入文件路径和输出文件路径:
python scripts/calculate_attendance.py <input.xlsx> <output.xlsx>
脚本会自动完成以下全部计算和输出。
考勤规则(已内置在脚本中)
打卡分类(午间区智能分配)
| 时间范围 | 分类逻辑 |
|---|---|
| < 11:00 | 归上午 |
| 11:00~12:30(午间区) | ≥2张卡:第一张归上午(下班卡),其余归下午(上班卡) |
| 11:00~12:30(午间区) | =1张卡:<12:00归上午,≥12:00归下午 |
| > 12:30 | 归下午 |
工时计算
| 时段 | 规则 |
|---|---|
| 上午(7:30-11:00) | 按实际工作时长(第一卡~末卡,两端不超7:30/11:00),半小时进位(余>20),上限 3.5h |
| 下午(12:30-17:00) | 按实际工作时长(12:30~下午末卡,不超17:00),半小时进位(余>20),上限 4.5h |
| 加班(17:00后) | 超出分钟 ÷ 30,余数 > 20 则进位 |
加班进位示例
20:57 - 17:00 = 237 min
237 ÷ 30 = 7 余 27
27 > 20 → 进位 = 8 × 0.5 = 4.0h
特殊情况
- 总打卡次数 < 2 → 无法计算,显示
- - 上午仅1次打卡 → 上午 = 0
- 下午仅1次打卡 → 下午 = 0
- 迟到/早退自然由实际工作时间体现,无需单独规则
- 所有工时结果小数点后只有
.0或.5
输出格式
- 在每人数据行下方插入一行,列A标注 "当天时长"
- 该行用浅黄色底色(#FFF2CC)标注
- 列G起填入每日工时(如
11.5、8.0、-),日期列数与原始打卡列数一致 - 数字格式为
0.0
注意事项
- 需要
openpyxl库。若未安装,先执行pip install openpyxl - 原始文件不做任何修改,结果写入新的输出文件
- 如遇编码问题,使用
str(cell.value)确保正确处理中文字符
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决企业考勤工时计算的明确痛点,属于高频刚需场景
- 具有广泛受众的实用能力,能显著提升HR工作效率
Highlights
- 触发词覆盖考勤相关场景完整,包括考勤、打卡、工时计算等
- 边界清晰,不易与其他Skill重叠
Areas to improve
-
缺少When to Use章节 Reported severity: Minor
文档中缺少明确的使用场景说明章节
Recommendation: 建议添加When to Use章节,明确说明何时使用此Skill
-
缺少端到端示例 Reported severity: Minor
虽然有执行流程说明,但缺少完整的端到端使用示例
Recommendation: 建议添加一个完整的端到端使用示例,展示从输入文件到输出结果的完整流程
Highlights
- 执行流程清晰,步骤划分明确
- 考勤规则说明详细,包含具体的时间范围和计算逻辑
Areas to improve
-
缺少脚本文件内容验证 Reported severity: Minor
文档中提到了scripts/calculate_attendance.py脚本,但未提供脚本内容或验证其完整性
Recommendation: 建议提供脚本文件内容或确保脚本文件完整可用
Highlights
- 工具来源明确,使用openpyxl库处理Excel文件
- 参数说明清晰,有详细的输入输出路径说明
- 有异常处理说明,如编码问题和打卡次数不足的情况
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 78
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.