Metadata-Version: 2.4
Name: sorteador-injusto
Version: 0.1.2
Summary: Librería de manipulación de CSVs y asignación de grupos con sesgo intencionado.
Author-email: Belategui Luken eta Jausoro Martin <martin.jausoro@alumni.mondragon.edu>
License: MIT
Keywords: sorteo,grupos,trampa,universidad
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0.0
Dynamic: license-file

Sortador Injusto

    Python library developed for the management, grouping, and assignment of tasks from datasets in CSV format.

Installation

    The package can be installed via the pip package manager pointing to the .whl file generated in the local distribution:
        pip install sorteador-injusto   

    Required dependencies:
        The system will automatically install pandas>=2.0.0 if it is not available in the environment. Python 3.8 or higher is required.

Data File Structure (CSV)

    The system processes information from two independent CSV files. It is strictly necessary that the first row of each document contains the header indicated below.

    1. Participants file (e.g., alumnos.csv)
        Requires the mandatory column Nombre.

    2. Tasks file (e.g., tareas.csv)
        Requires the mandatory column Tarea.  

Basic Module Usage

    The library exposes two main classes: SorteadorJusto (for transparent behavior based on random selection) and SorteadorInjusto (child class that overwrites the methods to apply an intentional bias against a specific victim or target).

    The victima parameter is defined when instantiating the class. It is mandatory and must exactly match (case and accent-sensitive) the string stored in the Nombre column of the alumnos.csv file.

    Once the class is instantiated with this parameter, all internal methods (elegir_voluntario, agrupar_alumnos, crear_enfrentamientos) will intercept this student to isolate them, expose them, or guarantee they face the toughest evaluation.

Quick Code Example

    from sorteador_injusto import SorteadorJusto, SorteadorInjusto

    # Instanciar el sorteador injusto definiendo la víctima
    sorteador = SorteadorInjusto('ruta_alumnos.csv', 'ruta_tareas.csv', victima="Nombre Apellido")

    # Obtener el voluntario (siempre será la víctima)
    voluntario = sorteador.elegir_voluntario()

    # Agrupar alumnos y asignar tareas sesgadas
    grupos = sorteador.agrupar_alumnos(tamano=2)
    tareas = sorteador.asignar_tareas(peor_tarea="Hacer el peor trabajo")

Description of Main Methods

    elegir_voluntario(): Returns a random record from the set of participants. In the derived class, it invariably returns the record designated as the target.

    agrupar_alumnos(tamano): Segments the dataset into subgroups of the specified dimension. In the biased implementation, the target record is excluded from the main iteration and isolated in a unitary subgroup.

    asignar_tareas(peor_tarea): Distributes the values of the task set among the participants. The derived implementation guarantees the assignment of the peor_tarea parameter to the target record before randomly processing the rest of the set.

    exportar_datos(ruta_salida): Dumps the current state of the DataFrame object in memory to a physical file in CSV format.

Authors

    Developed as an academic project by:
    Belategui Luken
    Jausoro Martin

License

    This software is distributed under the terms of the MIT License (Open Source).
