https://github.com/mrsobakin/scm
https://github.com/mrsobakin/scm
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mrsobakin/scm
- Owner: mrsobakin
- Created: 2022-07-22T12:59:49.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-22T13:54:58.000Z (almost 3 years ago)
- Last Synced: 2025-04-13T11:15:10.799Z (2 months ago)
- Language: Python
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sirius Courses Metrics
A tool for calculating difficulty metrics and generating analytic reports for Sirius Courses
## Installation
```bash
git clone https://github.com/mrsobakin/scm.git
cd scm
pip install .
```## Using
### Standalone
SCM can be used as a standalone tool.
For exporting metrics `csv` subcommand is used.
`python -m scm csv "path/to/data" "path/to/metrics/folder"`Report is generated with `report` subcommand.
`python -m scm csv "path/to/data" "path/to/report/file"`### As a module
SCM can also be used as a python module. Below is a simple example for generating report.
```python
from scm.metrics import SiriusCoursesMetricCalculator
from scm.types import *
import scm.report# Loading csv files
data = SiriusCoursesData.from_path("path/to/some/data")scmc = SiriusCoursesMetricCalculator()
# Calculating metrics
metrics = scmc.calc_metrics(data, "*", config = {
"avg_try_count": {
"upper_clip": 50
}
})# Creating course structure
course = Course.from_data(data, metrics)[0]# Generating report
html = scm.report.from_course(course)with open(args[1], "w") as f:
f.write(str(html))
```