Skip to main content

Python interface to your timewarrior database

Project description

A Python API for Timewarrior, originally by Tjaart van der Walt @tjaartvdwalt, now maintained here. Archived original is on gitlab.

Installation

For this API to work, you need Timewarrior installed

Installation is easy from the Python Package Index

pip install timew

API Documentation

Documentation is generated by Sphinx apidocs, from embedded docstrings in napoleon format. We generate .rst files, which are checked into the repository and can be previewed online.

The timewarrior module contains the interesting docs, while the formal doctree are rendered to an index and a more concise modules file.

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

Report bugs, submit inquiries, or request features via issues.

Please submit a pull request for modifications. Make sure the dist, test and docs Makefile targets work. Docs need to be kept generated during development, because they are checked in assets.

The build environment and tools will contain themselves in a venv within the source tree, and should not pollute your system.

Commits

Use the following format for commit messages:

X subsystem: summary description of change

long description text paragraphs
...

where X is a single character from the following:

/

fix

^

removal

-

task/chore

+

feature/new

=

comment/code-equal

All text should [usually] be wrapped by 79 characters, especially the summary line.

For subsystem, use your best judgement, and look at previous commits with git log –oneline to get an idea and for consistency with previous changes. More than one level of subsystem can make sense.

Please use interactive rebase to make commits look nice and have one logical change each, with no merge commits.

Thanks.

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.2.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

timew-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file timew-0.2.0.tar.gz.

File metadata

  • Download URL: timew-0.2.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.6

File hashes

Hashes for timew-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c7f85b35970c2c7a88cd87c4845aae6ab36276b647c21afb1e6344a1e5a1c9dc
MD5 04d8fbb4bcf57026bd3c95167140f814
BLAKE2b-256 2a9a33f58179d084c34342b30614905c6e300e39c0a35dae544aa1745cddb372

See more details on using hashes here.

File details

Details for the file timew-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: timew-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.6

File hashes

Hashes for timew-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13cbf17ad76086652ae135b7e8c4b8d06831636959b93c3336ec63dc1bd738be
MD5 1844398f3602769578fd38e21c659f6f
BLAKE2b-256 ca4f5667218cbc953ea51f02648a0332dad20a1b23e76179b3a8c8a8461a4a8b

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