Skip to content

HashedVsy/TerminalNotesApp

Repository files navigation

Terminal Notes Application

A simple command-line notes application written in Python with JSON import/export functionality.

Features

  • Create new notes with UUID-derived integer IDs (128-bit random space, globally unique, collision-safe)
  • Remove notes by ID
  • Modify existing note content
  • View all notes with formatted display
  • Export notes to JSON file
  • Import notes from JSON file (with merge or replace options)
  • Cross-platform compatibility (Windows, Linux, macOS)

Recent Updates

  • IDs switched to UUIDv4. New notes receive a UUIDv4-derived integer ID, independent of wall-clock timing and safe even under scripted / rapid creation. Note IDs are displayed and entered as decimal integers (type or paste the full number when prompted to remove or change a note). Notes files written by older versions (with timestamp-based integer IDs) still load unchanged — IDs are compared as integers in both formats. Caveat: older notes retain their time-sortable timestamp IDs, so sorting by ID keeps old notes in chronological order; new UUID IDs are not chronologically ordered.
  • Concurrent-edit data-loss fixed. In create_note, change_note, remove_note, and import_notes_json, the notes file is now reloaded after all blocking user prompts. If another process or terminal instance edits notes.json while you are at an input prompt, their edit is preserved on save instead of being silently overwritten.
  • Import-merge ID collision fixed. Importing a JSON file whose notes share content (and therefore had colliding reassigned IDs in the old loop) now produces a file with strictly unique IDs, even when the current notes file is empty or the import contains internal duplicates.

Files

  • main.py - Main application code
  • notes.json - Data storage file (created automatically)
  • package_linux.sh - Script to create standalone executable for Linux/macOS using PyInstaller
  • package_win.ps1 - Script to create standalone executable for Windows PowerShell 5.1+ using PyInstaller
  • tests/ - Directory containing unit tests
  • .github/workflows/test.yml - GitHub Actions workflow for continuous integration

Getting Started

Prerequisites

  • Python 3.6+ (tested with Python 3.14)
  • No external dependencies required (uses only Python standard library)

Running the Application

python main.py

Follow the on-screen menu to interact with the application.

Running Tests

# Discover and run all tests
python -m unittest discover -s tests -v

# Run specific test file
python -m unittest tests.test_terminalnotesapp -v

Creating Executable Bundles

Linux/macOS

bash package_linux.sh

The executable will be created in ./dist/terminalnotesapp

Windows (PowerShell 5.1+)

powershell -ExecutionPolicy Bypass -File package_win.ps1

The executable will be created in ./dist/terminalnotesapp.exe

Development

Project Structure

.
├── main.py                 # Main application
├── notes.json              # Data storage (auto-generated)
├── package_linux.sh        # Linux/macOS build script
├── package_win.ps1         # Windows build script
├── tests/                  # Unit tests
│   └── test_terminalnotesapp.py
├── .github/
│   └── workflows/
│       └── test.yml        # GitHub Actions CI/CD
├── TESTING.md              # Testing documentation
└── .gitignore              # Git ignore rules

Testing

The project includes a comprehensive test suite covering:

  • Note creation, reading, updating, deletion
  • JSON import/export functionality
  • Error handling and edge cases
  • File I/O operations

To run tests:

python -m unittest discover -s tests -v

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a pull request

License

This project is open source and available under the GPLv3 License.

Acknowledgments

  • Built with Python standard library
  • Packaging powered by PyInstaller

About

A Simple Terminal Notes App.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors