Skip to main content

The Dart CLI and Python Library

Project description

Dart Tools

PyPI Supported Python Versions License

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.

Installation

In the terminal, install by running

pip install dart-tools

Naming conflicts

If you have a preexisting shell command named dart, a quick fix is to run which -a dart and fine the path for this dart application. Then you can create an alias and add it to your shell profile file (.zshrc, .bashrc, etc.). For example, open ~/.zshrc and add a line like alias dartai="/path/to/dart", save it, and restart your terminal.

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 task-create "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 task-create --help.

Another common workflow is to updating a preexisting task. To do this, run something like

dart task-update [ID] -s Done

This command will mark the referenced task 'Done'. Here [ID] is meant to be replaced (including the brackets) with the ID of an existing task. You can get a ID 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. Alternatively, copy your authentication token from your Dart profile and save that as 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.id, status_title="Done")

Using the Python Library in AWS Lambda Functions

To use the dart-tools Python library in an AWS Lambda function, you need to package the library with your Lambda deployment package (see more details at Working with .zip file archives for Python Lambda functions). Follow these steps:

Navigate to the directory containing your lambda_function.py source file. In this example, the directory is named my_function.

cd my_function

Create a Deployment Package

Use Docker to create a deployment package that includes the dart-tools library. Run the following commands in your terminal, ensuring that the RUNTIME_PYTHON_VERSION and RUNTIME_ARCHITECTURE environment variables match the runtime settings of your Lambda function:

export RUNTIME_PYTHON_VERSION=3.12
export RUNTIME_ARCHITECTURE=x86_64
docker run --rm --volume ${PWD}:/app --entrypoint /bin/bash public.ecr.aws/lambda/python:${RUNTIME_PYTHON_VERSION}-${RUNTIME_ARCHITECTURE} -c "pip install --target /app/package dart-tools"

This command installs the dart-tools library into a directory named package in your current working directory.

Zip the contents of the package directory along with your lambda_function.py

cd package
zip -r ../my_deployment_package.zip .
cd ..
zip -r my_deployment_package.zip lambda_function.py

Deploy the Lambda function

Upload the my_deployment_package.zip file to AWS Lambda using the AWS Management Console or the AWS CLI.

By following these steps, you can use the dart-tools Python library within your AWS Lambda functions.

Help and Resources

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dart_tools-0.7.5.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

dart_tools-0.7.5-py3-none-any.whl (88.2 kB view details)

Uploaded Python 3

File details

Details for the file dart_tools-0.7.5.tar.gz.

File metadata

  • Download URL: dart_tools-0.7.5.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.22

File hashes

Hashes for dart_tools-0.7.5.tar.gz
Algorithm Hash digest
SHA256 06b1b54691226f3f37387c5fc6d966a62daa7cfe1614d76db83c462485d4040d
MD5 9aeb5f17fa3e299ebf16e4c2ee66f95e
BLAKE2b-256 62fde89328372205ce311d7e4bba44dc61ad5a4e79340a18220b61a9f1342fc0

See more details on using hashes here.

File details

Details for the file dart_tools-0.7.5-py3-none-any.whl.

File metadata

  • Download URL: dart_tools-0.7.5-py3-none-any.whl
  • Upload date:
  • Size: 88.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.22

File hashes

Hashes for dart_tools-0.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 49b670f311b2f1f47667ddce8ffba7639b46d967a79f59622c290e1dad29e4e6
MD5 449e8d4d279d7b0583f0b0f4729d77d2
BLAKE2b-256 7764fb5d813209c48ebdc17e54a995b10e8b233c1f09a56cda40c4130624f242

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page