### Install Pre-Commit Hooks for Linting Source: https://github.com/bergercookie/taskw-ng/blob/master/CONTRIBUTING.md This command installs the pre-commit hooks, which automate linting and formatting checks on every new commit, ensuring code quality and consistency. ```sh pre-commit install ``` -------------------------------- ### Install Python Dependencies and Activate Poetry Shell Source: https://github.com/bergercookie/taskw-ng/blob/master/CONTRIBUTING.md This snippet demonstrates how to install project dependencies using Poetry and how to activate the virtual environment shell, providing access to all development tools. ```sh poetry install poetry shell ``` -------------------------------- ### GNU GPLv3 Interactive Program Startup Notice Source: https://github.com/bergercookie/taskw-ng/blob/master/LICENSE.txt This snippet illustrates the short notice that programs should output when starting in an interactive mode. It informs users about the program's copyright, the absence of warranty, and the conditions for redistribution under the GNU General Public License, directing them to specific commands for more details. ```Plaintext Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Install taskw-ng using pip Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Instructions on how to install the `taskw-ng` library using pip, after ensuring Taskwarrior is installed. ```sh pip install taskw-ng ``` -------------------------------- ### Run Project Tests with Pytest Source: https://github.com/bergercookie/taskw-ng/blob/master/CONTRIBUTING.md This command executes all project tests using Pytest. The test configuration for this project, along with other tool configurations, can be found in the `pyproject.toml` file. ```sh pytest ``` -------------------------------- ### GNU GPLv3 License Notice for Source Files Source: https://github.com/bergercookie/taskw-ng/blob/master/LICENSE.txt This snippet provides the recommended boilerplate text for attaching the GNU General Public License version 3 notice to the start of each source file. It includes placeholders for the program's name, copyright year, and author, along with the standard declarations regarding free software, redistribution, modification, and the disclaimer of warranty. ```Plaintext Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ``` -------------------------------- ### Format Git Commit Messages Source: https://github.com/bergercookie/taskw-ng/blob/master/CONTRIBUTING.md This snippet provides examples of good and bad Git commit message practices, emphasizing the imperative form, capitalization, and optional side prefixes for clarity and consistency in commit history. ```gitcommit # ❌ don't do... implemented feature A for google calendar # ✅ instead do... [gcal] Implement feature A # ✅ if this is about a synchronization that's about two sides, join them by # a dash... [tw-gcal] Fix regression in Taskwarrior - Google Keep todo blocks integration. ``` -------------------------------- ### Configure taskw-ng with a custom Taskwarrior database Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Demonstrates how to initialize `TaskWarrior` to use a different Taskwarrior configuration file, allowing interaction with multiple databases. ```python from taskw_ng import TaskWarrior w = TaskWarrior(config_filename="~/some_project/.taskrc") w.task_add("Use taskw_ng.") ``` -------------------------------- ### Load and inspect tasks with taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Demonstrates how to initialize `TaskWarrior`, load all tasks, and inspect their structure, showing keys like 'completed' and 'pending' and the type of individual tasks. ```python from taskw_ng import TaskWarrior w = TaskWarrior() tasks = w.load_tasks() tasks.keys() # ['completed', 'pending'] type(tasks['pending']) # type(tasks['pending'][0]) # ``` -------------------------------- ### Load and inspect Taskwarrior configuration with taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Shows how to retrieve the current Taskwarrior configuration using `taskw-ng` and access specific configuration parameters like data location or color settings. ```python from taskw_ng import TaskWarrior w = TaskWarrior() config = w.load_config() config['data']['location'] # '/home/threebean/.task' config['_forcecolor'] # 'yes' ``` -------------------------------- ### Add new tasks using taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Shows how to add new tasks to Taskwarrior using `taskw-ng`, including basic task creation and adding tasks with specific attributes like priority, project, and due date. ```python from taskw_ng import TaskWarrior w = TaskWarrior() w.task_add("Eat food") w.task_add("Take a nap", priority="H", project="life", due="1359090000") ``` -------------------------------- ### Mark tasks as complete with taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Explains how to mark a task as 'done' or completed using its ID. ```python from taskw_ng import TaskWarrior w = TaskWarrior() w.task_done(id=46) ``` -------------------------------- ### Update existing tasks with taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Demonstrates how to retrieve a task, modify its attributes (e.g., project name), and then save the changes back to Taskwarrior. ```python from taskw_ng import TaskWarrior w = TaskWarrior() id, task = w.get_task(id=14) task['project'] = 'Updated project name' w.task_update(task) ``` -------------------------------- ### Retrieve a specific task by ID with taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Illustrates how to fetch a single task from Taskwarrior using its ID. ```python from taskw_ng import TaskWarrior w = TaskWarrior() w.get_task(id=5) ``` -------------------------------- ### Handle Python-native types for Taskwarrior data with taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Illustrates how to enable marshaling in `taskw-ng` to automatically convert Taskwarrior data into Python-appropriate types, such as `datetime` objects for dates and `UUID` objects for UUIDs. ```python from taskw_ng import TaskWarrior w = TaskWarrior(marshal=True) w.get_task(id=10) # should give the following: # (10, # { # 'description': 'Hello there!', # 'entry': datetime.datetime(2014, 3, 14, 14, 18, 40, tzinfo=tzutc()) # 'id': 10, # 'project': 'Saying Hello', # 'status': 'pending', # 'uuid': UUID('4882751a-3966-4439-9675-948b1152895c') # } # ) ``` -------------------------------- ### Delete tasks by ID using taskw-ng Source: https://github.com/bergercookie/taskw-ng/blob/master/README.md Shows how to remove a task from Taskwarrior using its unique ID. ```python from taskw_ng import TaskWarrior w = TaskWarrior() w.task_delete(id=3) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.