Metadata-Version: 2.1
Name: dart-tools
Version: 0.4.10
Summary: The Dart CLI and Python Library
Author-email: Dart Software Team <software@itsdart.com>
License: MIT License
        
        Copyright (c) 2023 Dart
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://www.itsdart.com/?nr=1
Project-URL: Web App, https://app.itsdart.com/
Project-URL: Help Center, https://its-dart.notion.site/Dart-Help-Center-8206a2aa2956496f8988b7b32cdcd205
Project-URL: Bugs and Features, https://github.com/its-dart/dart-tools/issues
Project-URL: Library Source, https://github.com/its-dart/dart-tools/
Keywords: dart,cli,projectmanagement,taskmanagement
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Groupware
Classifier: Topic :: Office/Business :: Scheduling
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

<div align="center">
  <h1>Dart Tools</h1>
  <p>
    <a href="https://pypi.org/project/dart-tools"><img src="https://img.shields.io/pypi/v/dart-tools.svg" alt="PyPI"></a>
    <a href="tox.ini"><img src="https://img.shields.io/pypi/pyversions/dart-tools" alt="Supported Python Versions"></a>
    <a href="LICENSE"><img src="https://img.shields.io/github/license/its-dart/dart-tools" alt="License"></a>
  </p>
</div>

[Dart](https://itsdart.com?nr=1) 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
```bash
pip install dart-tools
```


## Using the CLI

As an example, start off by logging in with
```bash
dart login
```

Then, you can create a new task with a command along the lines of
```bash
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
```bash
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

In Python, you can run something like
```python
import os
from dart import is_logged_in, login, create_task, update_task

# Login based on information stored in environment variables, but only if needed
if not is_logged_in():
    login(email=os.environ["DART_EMAIL"], password=os.environ["DART_PASSWORD"])

# 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](mailto:support@itsdart.com) 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
```python
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 preform the update
response = dart.transact([task_update_op], TransactionKind.TASK_UPDATE)
```


## Help and Resources

- [Homepage](https://www.itsdart.com/?nr=1)
- [Web App](https://app.itsdart.com/)
- [Help Center](https://its-dart.notion.site/Dart-Help-Center-8206a2aa2956496f8988b7b32cdcd205)
- [Bugs and Features](https://github.com/its-dart/dart-tools/issues)
- [Library Source](https://github.com/its-dart/dart-tools/)
- [Chat on Discord](https://discord.gg/RExv8jEkSh)
- Email us at [support@itsdart.com](mailto:support@itsdart.com)
