Skip to main content

Python bindings for your timewarrior database

Project description

# timew - Python API for Timewarrior #

## Installation ##

For this API to work, you need [Timewarrior](https://taskwarrior.org/docs/timewarrior/download.html) installed

Installation is easy from the [Python Package Index](https://pypi.org/project/timew/)

```bash
pip install timew
```

## Examples ##

```bash
>>> from timew import TimeWarrior

>>> timew = TimeWarrior()

>>> timew.start(time=datetime(2018, 8, 15, 9, 0, 0), tags=['my tag'])
Tracking "my tag"
Started 2018-09-06T09:00:00
Current 07T13:20:45
Total 28:20:45

>>> timew.cancel()
Canceled active time tracking.

>>> timew.delete(1)
Deleted @1

>>> timew.join(1, 2)
Joined @1 and @2

>>> from timew import Duration
>>> from datetime import timedelta
>>> timew.lengthen(1, Duration(timedelta(minutes=30)))
Lengthened @1 by 0:30:00

>>> timew.move(1, datetime(2018, 8, 15, 9, 0, 0))
Moved @1 to 2018-09-05T09:00:00

>>> timew.shorten(1, Duration(timedelta(minutes=10)))
Shortened @1 by 0:10:00

>>> timew.split(1)
Split @1

>>> timew.start(tags=['my tag'])
Tracking "my tag"
Started 2018-09-07T13:37:00
Current 40:22
Total 0:03:22

>>> timew.stop()
Recorded "my tag"
Started 2018-09-07T13:37:00
Ended 40:53
Total 0:03:53

>>> timew.track(start_time=datetime(2018, 9, 7, 11, 0, 0), end_time=datetime(2018, 9, 7, 12, 0, 0))
Tracking "from 20180907T110000 - 20180907T120000"
Started 2018-09-07T13:42:27
Current 27
Total 0:00:00
```

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

timew-0.0.4.zip (13.6 kB view details)

Uploaded Source

File details

Details for the file timew-0.0.4.zip.

File metadata

  • Download URL: timew-0.0.4.zip
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for timew-0.0.4.zip
Algorithm Hash digest
SHA256 9f083e6a0fe7ffbfeca2812936a87db907fa19afa641d33ff172883d41022000
MD5 f0e590a79462ba6613a8e9baed6e28d0
BLAKE2b-256 41cc32cd5e6983c4294352c8e14797c28808a219a4913a48c6cd6133641a9c82

See more details on using hashes here.

Supported by

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