How brkahmed/taskly works
Purpose and Entry Point
Taskly is a local command-line TODO manager. Its primary entry point is main() in taskly.py, exposed as the taskly command through package configuration in pyproject.toml. Users invoke subcommands to add, mutate, delete, and query tasks.
CLI Command Boundary
taskly.py owns argument parsing, command validation, and dispatch. Supported command paths are add, update, mark-in-progress, mark-done, delete, and list. The CLI is the sole application interface; no web server, API, or background worker is indicated.
Paths:
• taskly.py
• pyproject.toml
Persistent Task Store
Tasks are persisted as JSON through load_database(path) and save_database(database, path). Commands follow a read-modify-write lifecycle: load the database, apply an operation to the in-memory task collection, then save changes. This file-backed store is the primary state boundary and supports local, single-user operation.
Paths:
• taskly.py
Task Creation and Identity
add_task(database, description) creates task records with a unique ID and an initial todo status. Task identity is subsequently used by all mutation and deletion commands; descriptions and status are the main mutable fields.
Paths:
• taskly.py
Task Mutation Workflows
update_task can change description and/or status, while mark_in_progress_task and mark_done_task provide focused status-transition commands. These operations share the task-ID lookup boundary and operate on the loaded in-memory database before persistence.
Paths:
• taskly.py
Deletion and Querying
delete_task removes a task by ID. list_task is the read/query path: it displays all tasks or filters them by status (todo, in-progress, done, all) and creation-date comparisons (<, >, =). Listing reads stored state without requiring a mutation workflow.
Paths:
• taskly.py
Runtime and Validation
The project is Python-based, with runtime and packaging/dependency metadata in pyproject.toml and requirements.txt. test_taskly.py exercises the core behavior using pytest. The repository indicates no external database, cloud service, or network dependency; persistence is local JSON storage.
Paths:
• pyproject.toml
• requirements.txt
• test_taskly.py
Main entry points: taskly.py main() CLI · pyproject.toml Package command · requirements.txt Python runtime metadata · test_taskly.py Pytest coverage
Components 13
CLI Application
- Package command · Exposes the taskly command.
pyproject.toml - main() CLI · Parses, validates, and dispatches subcommands.
taskly.py
Task Operations
- Add task · Creates a uniquely identified todo task.
taskly.py - Update task · Changes a task description and/or status by ID.
taskly.py - Status transitions · Marks tasks in progress or done by ID.
taskly.py - Delete task · Removes a task by ID.
taskly.py - List tasks · Filters tasks by status or creation-date comparison.
taskly.py - In-memory tasks · Loaded task records used by command operations.
taskly.py
Local Persistence
- load_database()
taskly.py - save_database()
taskly.py - Local JSON database · Single-user persistent task store.
taskly.py
Other components
- Python runtime metadata
requirements.txt - Pytest coverage · Exercises core task behavior.
test_taskly.py
Connections 18
- Package command → main() CLI: exposes command
- Python runtime metadata → main() CLI: runs
- main() CLI → load_database(): loads state
- load_database() → Local JSON database: reads JSON
- load_database() → In-memory tasks: hydrates
- main() CLI → Add task: dispatches add
- main() CLI → Update task: dispatches update
- main() CLI → Status transitions: dispatches status commands
- main() CLI → Delete task: dispatches delete
- main() CLI → List tasks: dispatches list
- Add task → In-memory tasks: adds record
- Update task → In-memory tasks: mutates by ID
- Status transitions → In-memory tasks: updates status by ID
- Delete task → In-memory tasks: removes by ID
- List tasks → In-memory tasks: queries and filters
- In-memory tasks → save_database(): persists mutations
- save_database() → Local JSON database: writes JSON
- Pytest coverage → main() CLI: tests core behavior