Metadata-Version: 2.1
Name: wdc
Version: 0.3.8
Summary: Command line work day helper and logger
Home-page: https://github.com/dejanfajfar/wdc
Author: Dejan Fajfar
Author-email: dejan@fajfar.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Utilities
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Description-Content-Type: text/markdown
Requires-Dist: click
Requires-Dist: termtables
Requires-Dist: colored

# WDC

***Command line work day helper and logger***

![CI](https://github.com/dejanfajfar/wdc/workflows/CI/badge.svg)
[![PyPI version](https://badge.fury.io/py/wdc.svg)](https://badge.fury.io/py/wdc)

![Logo](doc/logo/cover.png)

# Purpose

The purpose of **wdc** is to provide a simple _CLI_ application for time tracking.

Born out of a nuisance that I could never tell when the working day was actually over and amazed overtime with little compensation.

# Description

Trying to come up with something better than: "timetracking in the CLI"

# Changelog

The changelog can be found [here](CHANGELOG.md)

# Installation

## From source code

Clone the repository:

```bash
git clone https://github.com/dejanfajfar/wdc.git .
```

If you have [make](https://www.gnu.org/software/make/) available then simply execute the **install** target

```bash
make install
```

If make is not available on your system then you can run the underlying python command. For that you have to navigate to the directory containing the ```setup.py``` file. In that directory execute

```bash
python setup.py install
```

# Time format

**wdc** uses a simplified time format similar to the military (_hhmm_). This uses a 24 hour format, so not AM/PM.

The table below should provide some additional information and clarification on how this time format maps to the more standard 24 and 12 hour format

| hhmm | 24 Hour | 12 hour |
|---|---|---|
|0000|00:00|12:00 AM
|0100|01:00|01:00 AM
|0200|02:00|02:00 AM
|0300|03:00|03:00 AM
|0400|04:00|04:00 AM
|0500|05:00|05:00 AM
|0600|06:00|06:00 AM
|0700|07:00|07:00 AM
|0800|08:00|08:00 AM
|0900|09:00|09:00 AM
|1000|10:00|10:00 AM
|1100|11:00|11:00 AM
|1200|12:00|12:00 PM
|1300|13:00|01:00 PM
|1400|14:00|02:00 PM
|1500|15:00|03:00 PM
|1600|16:00|04:00 PM
|1700|17:00|05:00 PM
|1800|18:00|06:00 PM
|1900|19:00|07:00 PM
|2000|20:00|08:00 PM
|2100|21:00|09:00 PM
|2200|22:00|10:00 PM
|2300|23:00|11:00 PM

The minutes work as _expected_.

# Date format

**wdc** uses the standard _ISO8601_ date format (```YYYY-MM-DD```).

***sample***

2020-10-25 -> 25th october 2020

# Commands

## calc

The calc command is used to calculate the theoretical end of the current working day.

**sample**

```bash
$ wdc calc 0800
1615
```

### Arguments

The time at which the work day started in the **hhmm** format

### Options

#### -b, --break_duration

The duration of the lunch break in minutes.

Default value is **30** minutes.

If no break was consumed can be provided as 0.

##### Examples

Working day with 30 minute break

```bash
$ wdc 0800 -b 30
```

Working day with no break

```bash
$ wdc 0800 -b 0
```

#### -d, --workday_duration

The duration of the workday in **hhmm** format

Default value is **0745**.

### Examples

An 8 hour workday starting at 8:00

```bash
$ wdc 0800 -d 0800
```

## start

Used to start a new work day task and store it.

> In order to start a new task you do not have to call an end command. Just start the new task and the old one will be automatically closed

**sample**

```bash
$ wdc start 0800 -t Customer -t Project -m The task description
```

### Arguments

The time at which the task started in the **hhmm** format

### Options

#### -t, --tag

Provide a generic tag to associate with the task.

Multiple tags can be provided, if so then each has to be provided with its own ```-t``` or ```--tag``` option.

#### -m, --message

Provide a descriptive message to associate with the task

#### -e, --end

Provide an optional end time for the task in **hhmm** format

#### -d, --date

Provide the date to which this task should be associated to.

### Examples

Start an anonymous task

```bash
$ wdc start 0800
```

Start a task with a know end time

```bash
$ wdc start 0800 -e 0900
```

Start a task for a date other than today

```bash
wdc start 0800 -d 2020-01-01
```

## end

Adds a end time to the last work task of the given day

> If no date is provided the today is takes as a default

**sample**

```bash
$ wdc end
```

### Arguments

No arguments supported by the command

### Options

#### -d, --date

Provide the optional date on which the last task should be closed

#### -e, --end

Provide an optional end time for the task in **hhmm** format

> If not provided then the current time is taken

### Examples

End current working day with by providing an end time

```bash
$ wdc end -e 1630
```

End last task from another day

```bash
$ wdc end -d 2020-10-25
```

## list

List all stored work tasks for the day

**sample**

```bash
$ wdc list
```

### Arguments

No arguments supported by the command

### Options

#### -d, --date

Provide optional date for which tasks should be listed

#### -a, --all

Flag to denote if all tasks should be shown, or not

> If set then the change history of each task will be returned

### Examples

List all tasks for today, even the internally duplicated ones

```bash
$ wdc list -a
```

List tasks for a given day

```bash
$ wdc list -d 2020-10-25
```

## info

Provides detailed information about the given task

***sample***

```bash
$ wdc info 0c3a9014
```

### Arguments

The **id** of the task already recorded

> The task ID can be retrieved with the list command

### Options

The command does not support any options at this point

### Examples

The only use case is shown in the sample.

## amend

Enables you to change an existing workday task

> The original task is not changes only a new revision added

***sample***

```bash
$ wdc amend 0c3a9014 -t my_tag
```

### Arguments

The **id** of the task to be altered

> The task ID can be retrieved with the list command

### Options

#### -s / --start

The new value of the task start time

#### -t /--tag

The new tags to be associated with the task

Multiple tags can be provided, if so then each has to be provided with its own ```-t``` or ```--tag``` option.

> Note that the new tags will override the old one, They will **NOT** be appended to the existing ones

#### -m / --message

The new message for the work task

#### -e / --end

The new value of the task end time

#### -d /--date

The new date for the work task

### Examples

Apply multiple tags to the existing task

```bash
$ wdc amend 0c3a9014 -t tag1 -t tag2
```

Update the start time, end time and the message of the task

```bash
$ wdc amend 0c3a9014 -s 0900 -e 1030 -m "Updated message"
```


