Coder Social home page Coder Social logo

jefersonfg / moodle-log-anonymizer Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 38 KB

Python script for anonymizing the logs provided by Moodle, changing the students names to random ones (but keeping the same name for the same student) and removing the access origin and IP columns

License: GNU General Public License v2.0

Python 100.00%

moodle-log-anonymizer's Introduction

Moodle log anonymizer

Python script for anonymizing the logs provided by Moodle, changing the students names to random ones (but keeping the same name for the same student) and removing the access origin and IP columns.

It also optionally anonymizes the grades of the students, making sure the same real name is mapped to the same fake name on both output files. When anonymizing the grades this script assumes the name and surname columns have been merged into one full name column, which is done by another script used in our current project, the moodle grades cleaner. It also assumes the email column has been removed, which the grades cleaner does, so you might need to explicitly add anonymization support here if you wish.

Dependencies

This project relies on the pandas module being available, as well as the openpyxl module necessary for writing and reading .xlsx files, format used by moodle when exporting the grades of students for a given course.

Usage

You can run the script with python 3.9 passing the path to the logs to be anonymized and the path for the result to be saved to:

python anonymizer.py moodle_logs.csv anonymized_moodle_logs.csv

You can also optionally pass the path to the grades to be anonymized as well as the path for the result to be saved to:

python anonymizer.py moodle_logs.csv anonymized_moodle_logs.csv --source_grades_path moodle_grades.xlsx --target_grades_path anonymized_moodle_grades.xlsx

Testing

The tests reside on the anonymizer_test.py file and use the unittest package, to run them execute:

python -m anonymizer_test

References

Based on the implementation of anonymoodle, which works on a slightly different log structure with another language.

moodle-log-anonymizer's People

Stargazers

 avatar

Watchers

James Cloos avatar Jéferson Guimarães avatar  avatar

Forkers

brunofeil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.