A small command-line changelog manager written in Python.
- Name: Leykun Hailemichael Hagos
- Student Number: 9241478125
This project stores software change notes in a plain text file named changelog.txt.
It is designed as a learning project for command-line argument parsing, file operations,
and structured text handling.
solution_v1.py: Main CLI implementation.test_spec.py: Automated test suite (pytest).SPEC.txt: Assignment/specification details.README.md: This documentation.
Entries are saved line-by-line in changelog.txt using this format:
id|date|type|description
Example:
1|2026-03-29|FIX|Resolved login crash
Creates changelog.txt in the current directory.
- Success output:
Changelog initialized. - If already exists:
Error: Changelog already initialized.
Appends a new entry into changelog.txt.
- Auto-ID starts from 1 and increments by counting existing lines.
- Date uses system date in
YYYY-MM-DDformat. - Success output:
Entry added. - If file is missing:
Error: Changelog not initialized. Run 'init' first. - If arguments are missing:
Error: Missing arguments for 'add'.
Not implemented yet (placeholder behavior).
- Output when initialized:
Command will be implemented in future weeks - If file is missing:
Error: Changelog not initialized. Run 'init' first.
Not implemented yet (placeholder behavior).
- Output when initialized with id:
Command will be implemented in future weeks - If file is missing:
Error: Changelog not initialized. Run 'init' first. - If id missing:
Error: Missing arguments for 'done'.
Deletes an entry by ID from changelog.txt.
- If matching ID exists:
Deleted task #<id> - If matching ID does not exist:
Task #<id> not found - If file is missing:
Error: Changelog not initialized. Run 'init' first. - If id missing:
Error: Missing arguments for 'delete'.
- No command:
Error: No command provided. - Unknown command:
Error: Unknown command.
Run commands from this project directory:
python3 solution_v1.py init
python3 solution_v1.py add FIX "Fixed bug 1"
python3 solution_v1.py list
python3 solution_v1.py done 1
python3 solution_v1.py delete 1This project uses pytest.
pytest -qLatest local status: 15 passed.
Only supported init and add. It used no loops or lists, meaning it could write data
but not display it dynamically.
V1 now uses while loops and list indexing to process changelog data into a readable
format and support search by type. The top of solution_v1.py includes a task comment
block describing these goals:
- Implement a while loop to read
changelog.txtand display all recorded entries. - Use string parsing (
split('|')) to format output into a readable table. - Add a search feature to filter entries by
type(for example,FIX,FEAT).
- Created
solution_v1.pyas the main implementation file. - Added a 3-task V1 comment block at the top of
solution_v1.py. - Removed
solution_v0.pyso only one solution file remains. - Updated tests to run
solution_v1.py. - Expanded this README into a detailed, all-inclusive project guide.