TaskDB is a simple, command-line interface (CLI) application for managing your to-do list. It connects to a PostgreSQL database to keep your tasks organized and persistent.
- Add new tasks to your to-do list.
- Delete tasks by their ID.
- Add a status to your tasks.
- List all current tasks.
- All data is stored in a PostgreSQL database.
- 0.1.4
- Users can now update a task's description with the 'update' command.
- Added an
--task-numoption to thedelete, 'status', and 'update' commands. - Users can reset an in-progress task's status using the "Not Started" argument.
- When listing all tasks the program now displays both the added date of the task along with its modified date.
- 0.1.3
- Adds the current date and time whenever users add a task or update a task's status.
- 0.1.2
- Users can display tasks according to their status.
- 0.1.1
- Added the
task_statuscommand.- Users can add either a
STARTEDorCOMPLETEDstatus to their tasks.
- Users can add either a
- Added the
- 0.1.0
- Initial release
Before you begin, ensure you have the following installed on your system:
- Python 3.8 or higher: You can check your version with
python3 --version. - Git: Required to clone the repository. You can check your version with
git --version. - A running PostgreSQL server: The application requires an active PostgreSQL instance to connect to.
Follow these steps to get the TaskDB application up and running on your local machine.
First, clone this repository to your local machine using Git:
git clone https://github.com/BrittanyGates/TaskDB.git
Then change directory into the TaskDB directory:
cd TaskDB
It is highly recommended to install the package in a virtual environment.
Learn more about virtualenvs, including how to create one, from the official Python Documentation.
Install the taskdb-cli package and all its dependencies using pip:
pip install .
This command reads the pyproject.toml file and installs the taskdb command so you can use it from your terminal.
The application connects to your database using credentials stored in an environment file.
Make a copy of the example environment file and name it .env:
cp .env.example .env
Open the newly created .env file in a text editor and fill in your PostgreSQL details. It should look something like this:
# Credentials to connect to your main PostgreSQL server (often 'postgres' user)
DEFAULT_DB_USER="postgres"
DEFAULT_DB_PASSWORD="your_postgres_password"
DEFAULT_DB_HOST="localhost"
DEFAULT_DB_PORT="5432"
DEFAULT_DB_NAME="postgres"
# Details for the new database that this program will create and use
TASKDB_NAME="taskdb"
TASKDB_USER="postgres"
TASKDB_PASSWORD="your_postgres_password"
TASKDB_HOST="localhost"
TASKDB_PORT="5432"
The final step is to run the database setup script. This will connect to your PostgreSQL server, create the taskdb database if it doesn't exist, and create the necessary tables.
Run the following command from the project's root directory:
python src/taskdb/database.py
You should see output indicating that the database was created and the schema was applied successfully. You only need to do this once.
Follow these steps if you installed version before 0.1.3 previously.
First, clone this repository to your local machine using Git:
git clone https://github.com/BrittanyGates/TaskDB.git
Then change directory into the TaskDB directory:
cd TaskDB
Run the following commands from the project's root directory:
python src/migrations/001_add_task_status_column.py
python src/migrations/002_add_date_and_time_columns.py
You should see output indicating that the database was updated and the schema was applied successfully. You only need to do this once.
Once installed and configured, you can use taskdb from your terminal.
taskdb --lall or taskdb --listall
taskdb --s or taskdb --started
taskdb --c or taskdb --completed
taskdb --n or taskdb --not-started
(Make sure to use quotes around your task description.)
taskdb add "Pick up groceries from the store"
taskdb delete --task-num=1
taskdb status --task-num=1 "started" or taskdb status --task-num=2 "completed" or taskdb status --task-num=3 "not started"
taskdb update --task-num1 "Updated task description"
taskdb --help
