Command-line notes tool
beginner1 weekPython
Add, list, search and delete notes from the terminal. Notes are stored in a local JSON file.
Why build it
Argument parsing, file I/O and error handling in a project small enough to finish in a weekend, and you will actually use it.
Features
- add, list, search and delete commands
- Tags on notes
- Data stored in a JSON file in the home directory
- Helpful error messages
- Colour output
Roadmap
- p1
Storage
- Define the note shape
- Read and write JSON safely, creating the file if missing
- Write functions with no printing so they are testable
- p2
Commands
- Use argparse subcommands
- Implement add and list
- Implement search and delete by id
- p3
Quality
- Tests with pytest and a temporary directory
- Handle a corrupted JSON file without losing data
- Add --help examples
- p4
Package
- Add pyproject.toml with a console script
- Install with pipx
- Publish the repo with a usage GIF
Common pitfalls
- Writing the file in place, so a crash mid-write corrupts all notes
- Mixing printing and logic so nothing can be tested
Skills you will practise
- argparse
- File I/O
- pytest
- Packaging