Python bindings for your timewarrior database
Project description
timew - Python API for Timewarrior
Installation
For this API to work, you need Timewarrior installed
Installation is easy from the Python Package Index
pip install timew
API Documentation
Examples
>>> 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
Contributing to timew
Code formatting
To avoid bikeshedding about code formatting, we use the following tools to format our code in a deterministic way:
Our CI pipeline will fail on code that does not conform. To check your code, run tox
in your local environment.
We recommend that you configure your favorite editor to run these commands on a shortcut. Here is an example of my Emacs configuration
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
timew-0.0.22.tar.gz
(6.0 kB
view details)
Built Distribution
timew-0.0.22-py3-none-any.whl
(15.5 kB
view details)
File details
Details for the file timew-0.0.22.tar.gz
.
File metadata
- Download URL: timew-0.0.22.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.7.2 Linux/4.19.23-coreos-r1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34f066d1766356254554bf2ad74fba9b2fd57ee003f862c53156d2024326977f |
|
MD5 | 230ec84187eb12f31b4f758f65b51a9e |
|
BLAKE2b-256 | 2b98c379b683ee6b6c369b9ec4bdc31914131f55a7cf9d2fddf48a8356bfaeef |
File details
Details for the file timew-0.0.22-py3-none-any.whl
.
File metadata
- Download URL: timew-0.0.22-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.7.2 Linux/4.19.23-coreos-r1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dca63535e33b9077b698d8ebd86ee317e185d6a03af86d1eb19b7a92e1b578b2 |
|
MD5 | d8cdc474228ea7dc86dc8af01bd39c68 |
|
BLAKE2b-256 | 70b47457dd1efd4776a9366ab34c629215a636e21f4bffda72a4f40e01138105 |