添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
坚韧的稀饭  ·  How to fix ...·  2 天前    · 
傻傻的课本  ·  Python 教程 — Python ...·  昨天    · 
英姿勃勃的火柴  ·  PEP 0 – Index of ...·  昨天    · 
开朗的茄子  ·  Spark - RCC User Guide·  昨天    · 
老实的香槟  ·  Degaulle(法国戴高乐)-- ...·  6 月前    · 
销魂的自行车  ·  ASP.NET Core Blazor ...·  1 年前    · 
朝气蓬勃的桔子  ·  Solved: SQL Server ...·  1 年前    · 

Repository files navigation

moss.py

A Python client for Moss : A System for Detecting Software Similarity

Introduction

It is a Python interface for Moss client. It was written for AutoGrader for handling similarity in Python assignment submission.

It was written using the original bash script/documentation and its PHP dialect.

Installation

pip install mosspy

Usage

import mosspy
userid = 987654321
m = mosspy.Moss(userid, "python")
m.addBaseFile("submission/a01.py")
m.addBaseFile("submission/test_student.py")
# Submission Files
m.addFile("submission/a01-sample.py")
m.addFilesByWildcard("submission/a01-*.py")
# progress function optional, run on every file uploaded
# result is submission URL
url = m.send(lambda file_path, display_name: print('*', end='', flush=True))
print()
print ("Report Url: " + url)
# Save report file
m.saveWebPage(url, "submission/report.html")
# Download whole report locally including code diff links
mosspy.download_report(url, "submission/report/", connections=8, log_level=10, on_read=lambda url: print('*', end='', flush=True)) 
# log_level=logging.DEBUG (20 to disable)
# on_read function run for every downloaded file

Python Compatibility

  • Python - v3
  • Similar Project

  • ocaml-moss OCaml client
  • cl-moss Common Lisp
  • moji Java version
  • MOSS-PHP PHP version
  • GUI for Windows GUI for Windows
  • License

    This project is licensed under the MIT License - see the LICENSE file for details