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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timew-0.3.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for timew-0.3.0.tar.gz
Algorithm Hash digest
SHA256 45927dcd854152153a714cd4cd3260f05e6098b6bd7a42c2dd7c7f4d170d42c9
MD5 f56e1e7ac9f77f1808f7d31511a15ed2
BLAKE2b-256 7b66d685d8dcf8705742ee7bcf7ed80a23a04f555e2e1d435364c0f82b00b9a6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for timew-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbe32d24fb532a34df438421172f1ba96fe196e0f1c6fcca29561f89430d6b60
MD5 c73f0169a26a754d44b4a7c6c708cbb3
BLAKE2b-256 f36283c9a60c79cc6b4f264686b1b09ae64c43789e53ce0b3d2f2c22fdcee999

See more details on using hashes here.

Supported by

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