Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/FranksGP/Gestor_de_tareas/llms.txt

Use this file to discover all available pages before exploring further.

Gestor de Tareas persists all task data in a file called Tareas.json, located in the working directory from which you run python index.py. The file is created automatically the first time a task is added and is updated in-place every time a task is added, completed, or deleted. Because the file is plain JSON, it can be inspected, copied, and archived with any standard text tool.

File structure

Tareas.json contains a single JSON array. Each element of the array is a JSON object representing one task. The array preserves insertion order, and the display index shown by listarTask() corresponds directly to each element’s position in the array (1-based).
[
    {
        "titulo": "Comprar leche",
        "descripcion": "Ir al supermercado por la tarde",
        "completed": false
    },
    {
        "titulo": "Estudiar Python",
        "descripcion": "Repasar funciones y manejo de archivos",
        "completed": true
    },
    {
        "titulo": "Llamar al médico",
        "descripcion": "Pedir cita para revisión anual",
        "completed": false
    }
]
When there are no tasks, the file contains an empty array:
[]

Field reference

Each task object contains exactly three fields. All three are required — guardarTask() writes only what agregarTask() and tareaCompletada() produce, so no optional or nullable fields exist in normal operation.
titulo
string
required
The short title of the task, supplied by the user when the task is created via option 1 of the interactive menu. Used as the primary identifier in listarTask() output and in the deletion confirmation message printed by delete_task().
descripcion
string
required
A longer description of the task, also supplied at creation time. Displayed next to titulo in the listarTask() output, separated by -.
completed
boolean
required
Tracks whether the task has been finished. Set to false when the task is created by agregarTask(). Changed to true by tareaCompletada(). This field is never set back to false by the application — once completed, a task stays completed until it is deleted and re-added. In listarTask() output, true renders as ✔ Completada and false as ✘ Pendiente.

File location

The filename is controlled by the TASKS_FILE constant defined at the top of index.py:
TASKS_FILE = "Tareas.json"
This is a relative path, so Tareas.json is always created in — and read from — the current working directory at the time python index.py is executed. If you run the script from /home/user/projects/, the file will be created at /home/user/projects/Tareas.json. See the Configuration reference for instructions on changing this path.

Error handling

Gestor de Tareas is designed to never crash due to a missing or corrupt Tareas.json.
  • File not found: cargarTask() checks for the file’s existence with os.path.exists() before attempting to open it. If the file is absent, the function returns []. The file is created fresh the next time guardarTask() is called (i.e., when the first task is added).
  • Malformed JSON: If Tareas.json exists but contains invalid JSON, cargarTask() catches the resulting json.JSONDecodeError and returns [] instead of raising an exception. The corrupted file is then overwritten with a valid empty-array JSON file the next time a task is saved.
Manually editing Tareas.json is possible — the four-space indentation produced by json.dump(..., indent=4) makes the file easy to read and modify. However, any syntax error introduced during manual editing (a missing comma, an unquoted key, a trailing bracket) will be treated as a JSONDecodeError by cargarTask(). This silently resets the task list to empty on the next save, causing all previously saved tasks to be permanently lost. Always validate your edits with a JSON linter before relying on the file.
Because Tareas.json is self-contained plain text, you can back up your task history at any time by copying the file: cp Tareas.json Tareas_backup_$(date +%F).json. You can also restore a previous list by replacing Tareas.json with a backup copy before starting the application.

Build docs developers (and LLMs) love