17 个版本
| 0.4.2 | 2023年11月4日 | 
|---|---|
| 0.4.1 | 2023年10月27日 | 
| 0.3.6 | 2023年10月27日 | 
| 0.2.9 | 2023年10月23日 | 
#929 在 解析实现
每月137 次下载
25KB
490 代码行
usask_cba_calc
这是一个命令行工具,旨在计算萨斯喀彻温大学工程学院一年级学生的成绩。该工具接受JSON格式的输入文件,并提供计算出的GPA和其他相关信息。该工具是用Rust编写的,以利用Rust出色的数据建模能力。
安装
- 
安装 Rust:如果您系统上尚未安装 Rust,您可以访问官方 Rust 网站并按照他们的安装说明进行操作。 
- 
安装二进制文件:使用 cargo 从 crates.io 安装二进制文件 cargo install usask_cba_calculator
- 
验证安装:在您的终端中运行以下命令 usask_cba_calc --help
输出应类似于以下内容,
Usage: usask-cba-calc [file_path]
Arguments:
    [file_path]  Path to file containing JSON data.
If no file path is provided, the program will read from stdin.
cli tool to calculate usask's first year engineering cba grades
usask-cba-calc v0.2.3
用法
- 
打开您的终端或命令提示符 
- 
输入 usask_cba_calc -s这将提出一些问题以生成模板 JSON 架构,稍后打开 grades.json 文件以填写您的成绩信息 
- 
输入 usask_cba_calc /path/to/file.json
注意:您也可以将数据管道输入到工具中。
输入文件架构
输入文件需要按照以下所示的特定布局结构化,请遵循以下布局
{
    "Subject1": {
        "CLOs": {
            "1.1": {
                "difficulty_type": "B",
                "weightage": 20.0,
                "RLOs": {
                    "1.3": {
                        "weightage": 50.0,
                        "assignments": [95, 90, 85]
                    },
                    "3.3": {
                        "weightage": 50.0,
                        "assignments": [80, 75]
                    }
                }
            },
            "1.2": {
                "difficulty_type": "B+",
                "weightage": 80.0,
                "RLOs": {
                    "1.1": {
                        "weightage": 50.0,
                        "assignments": [95, 90, 85]
                    }
                }
            }
        }
    },
    "Subject2": {
        "CLOs": {
            "2.1": {
                "difficulty_type": "A",
                "weightage": 0.0,
                "RLOs": {
                    "2.1": {
                        "weightage": 100.0,
                        "assignments": [12]
                    }
                }
            },
            "1.2": {
                "difficulty_type": "B+",
                "weightage": 100.0,
                "RLOs": {
                    "2.2": {
                        "weightage": 100.0,
                        "assignments": [95, 0, 0]
                    }
                }
            }
        }
    }
}
依赖关系
~2.9–5MB
~84K SLoC