The Dart CLI and Python Library
Project description
Dart is Project Management powered by AI.
dart-tools
is the Dart CLI and Python Library. It enables direct integration with Dart through a terminal CLI or through Python.
Setup
In the terminal, install by running
pip install dart-tools
Using the CLI
Start off by setting up authentication with
dart login
Then, you can create a new task with a command along the lines of
dart createtask "Update the landing page" -p0 --tag marketing
which will make a new task called 'Update the landing page' with priority 'Critical' (i.e. P0) and with the 'marketing' tag.
You can explore all of these options and many more with dart --help
or the more specific help for subcommands, in this case dart createtask --help
.
Another common workflow is to updating a preexisting task. To do this, run something like
dart updatetask [DUID] -s Done
This command will mark the referenced task 'Done'. Here [DUID]
is meant to be replaced (including the brackets) with the 'Dart ID' of an existing task. You can get a DUID from any existing task in a number of ways, such as by copying it from the end of a task's URL or by clicking the '...' button in a task page in Dart and then choosing 'Copy ID'.
Using the Python Library
First, set up authentication. Run dart login
in the terminal for an interactive process, or visit your Dart profile and then run dart.login(token)
or save the token into the DART_TOKEN
environment variable.
Then, you can run something like
import os
from dart import create_task, is_logged_in, update_task
# Check that auth is set up and stop if not, can remove this once everything is set up
is_logged_in(should_raise=True)
# Create a new task called 'Update the landing page'
# With priority 'Critical' (i.e. p0) and with the 'marketing' tag
new_task = create_task(
"Update the landing page", priority_int=0, tag_titles=["marketing"]
)
# Update the task to be 'Done'
update_task(new_task.duid, status_title="Done")
Advanced Usage
Almost anything that can be done in Dart can be done with the Python library, but there are not convenient wrapper functions for everything. For most advanced usage, the best thing to do is to get in touch with us and we can help.
However, if you want to explore on your own, the client is well-typed, so you can simply explore the code to see what is possible.
All updates will go through the the dart.transact
function.
As an example, you could run something akin to update_task
with
from dart import (
Dart,
Operation,
OperationKind,
OperationModelKind,
TaskUpdate,
TransactionKind,
)
# Initialize the inner client
dart = Dart()
# Prepare the update operation
task_update = TaskUpdate(
duid="[DUID]",
size=5,
)
task_update_op = Operation(
model=OperationModelKind.TASK,
kind=OperationKind.UPDATE,
data=task_update,
)
# Call the operation transactionally to perform the update
response = dart.transact([task_update_op], TransactionKind.TASK_UPDATE)
Help and Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dart_tools-0.6.9.tar.gz
.
File metadata
- Download URL: dart_tools-0.6.9.tar.gz
- Upload date:
- Size: 108.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973bba08c4d16f913de39cff52cb8c32d60d0dddb7b9766aac0eb3e65512a3b7 |
|
MD5 | 3b7051095185ad7d95f7bbfb5858d5bf |
|
BLAKE2b-256 | 189709dce360f2ba81aeaeafa0b5e0db4f39b369774199c55e19c3338fbf72af |
File details
Details for the file dart_tools-0.6.9-py3-none-any.whl
.
File metadata
- Download URL: dart_tools-0.6.9-py3-none-any.whl
- Upload date:
- Size: 272.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1a99e030cddbab6bdd10ad508a0ec25d2a00884078d713e8fe374e165747ef3 |
|
MD5 | 2a6467c91a6cb1b12cfeae957e0974bf |
|
BLAKE2b-256 | 18662043c9c2ee0304ce1d325047281a664be8df02880f29cccda779f35d70e3 |