All Projects → mattduck → org-toggl-py

mattduck / org-toggl-py

Licence: MIT license
Create Toggl entries from Emacs org-mode CLOCK entries

Programming Languages

python
139335 projects - #7 most used programming language
emacs lisp
2029 projects
shell
77523 projects

Projects that are alternatives of or similar to org-toggl-py

vscode-text-tables
VSCode extension that brings the power of Emacs table editing
Stars: ✭ 36 (-12.2%)
Mutual labels:  org-mode
toggl2clockify
Migrate data from toggl to clockify
Stars: ✭ 21 (-48.78%)
Mutual labels:  toggl
OrgMode.jl
A Julia library for working with Org.
Stars: ✭ 52 (+26.83%)
Mutual labels:  org-mode
org-gantt
Gantt chart for emacs org-mode
Stars: ✭ 55 (+34.15%)
Mutual labels:  org-mode
org-sync-snippets
Simple extension to export snippets to org-mode and vice versa
Stars: ✭ 14 (-65.85%)
Mutual labels:  org-mode
finito.el
📚 Manage books with Emacs 📚
Stars: ✭ 34 (-17.07%)
Mutual labels:  org-mode
uniorg
An accurate Org-mode parser
Stars: ✭ 190 (+363.41%)
Mutual labels:  org-mode
gcal
Google Calendar Utilities for Emacs
Stars: ✭ 12 (-70.73%)
Mutual labels:  org-mode
yeonghoey
A personal knowledge base
Stars: ✭ 13 (-68.29%)
Mutual labels:  org-mode
toggl
Custom PHP library to connect with the Toggl API - developed by Ixudra
Stars: ✭ 23 (-43.9%)
Mutual labels:  toggl
ox-ssh
SSH config export for org-mode
Stars: ✭ 33 (-19.51%)
Mutual labels:  org-mode
PKMigrator
Tools to migrate between various Personal Knowledge Management Utilities
Stars: ✭ 36 (-12.2%)
Mutual labels:  org-mode
org-roam-ui
A graphical frontend for exploring your org-roam Zettelkasten
Stars: ✭ 1,393 (+3297.56%)
Mutual labels:  org-mode
nast
A block-based intermediate representation for document-like content.
Stars: ✭ 35 (-14.63%)
Mutual labels:  org-mode
org-outer-indent
An outer indentation org mode
Stars: ✭ 25 (-39.02%)
Mutual labels:  org-mode
idle-org-agenda
A package that shows your agenda when Emacs is idle
Stars: ✭ 40 (-2.44%)
Mutual labels:  org-mode
nroam
Org-roam backlinks within org-mode buffers
Stars: ✭ 106 (+158.54%)
Mutual labels:  org-mode
copy-as-org-mode
A Firefox Add-on (WebExtension) to copy selected web page into Org-mode formatted text!
Stars: ✭ 138 (+236.59%)
Mutual labels:  org-mode
org-hexo
[DEPRECATE] Convert your org-mode blog to hexo markdown file
Stars: ✭ 20 (-51.22%)
Mutual labels:  org-mode
org-rich-yank
📋 Rich text clipboard for org-mode: Paste as a #+BEGIN_SRC block of correct mode, with link to where it came from
Stars: ✭ 59 (+43.9%)
Mutual labels:  org-mode

2020-03-06: I haven't actively used this for a few years now, but it is apparently still working. I'm happy to merge in any fixes or sensible-looking changes.

org-toggl-py

Create Toggl time tracking entries from Emacs org-mode CLOCK entries, by assigning TOGGL_PID and TOGGL_TID properties to your org headings.

See below for how to use the org-toggl.sh script. The command runs Emacs from the CLI and exports your org data as a JSON file to $original_path.org.json. It then processes the JSON in Python and uploads the relevant data to the Toggl API. I've implemented it like this beacuse it's easy to develop and automate / run as a cron job.

Installation

  • pip install -r requirements.txt to install the Python dependencies.

  • Emacs should have the json.el library installed. This is part of GNU Emacs since 23.1 (2008).

Usage

  • The main command is org_toggl.sh <config_path> <org_file_path> [<extra_emacs_files_to_load> ...].

    • config_path: Path to an org-toggl configuration file, described below.

    • org_file_path: The org file to be processed for Toggl entries.

    • extra_emacs_files_to_load: Before exporting the org file, optionally load these files in Emacs, in the given order. You can use this to eg. load some custom org-mode setup so your files are exported with the correct keywords.

  • Toggl takes priority over org-mode: a CLOCK entry is not pushed to Toggl if there is already a Toggl entry that starts within the CLOCK time period.

    • Except: CLOCK entries that start in the same minute that a Toggl entry ends are allowed, because that can naturally occur in org-mode.

Configuration

[org-toggl-py]

# Your Toggl API token
toggl_api_token = <token>

# Your Toggl workspace ID
toggl_wsid = <id>

# CLOCK entries that have a closed time older than this are skipped
skip_clocks_older_than_days = 7

Org-mode headline properties

  • TOGGL_PID - If this value is a Toggl project ID, the entry will be assigned to that project. If this value is t, the entry will be pushed to Toggl without a project. CLOCK entries are only uploaded if TOGGL_PID has one of these values.

    • Property values are inherited: you can set this on a parent headline representing a project on Toggl, and all child headlines will have their CLOCK values uploaded.
  • TOGGL_TID - Task ID support is partially implemented, I haven't tested it yet.

  • TOGGL_IGNORE - If a parent headline has a TOGGL_PID or TOGGL_TID set, you can assign TOGGL_IGNORE to any value to ignore processing for a headline and its children.

JSON

The org-export-json function in org-export-json.el can be used to export an org-mode buffer from Emacs to a JSON file. This is adapted from a post on the org-mode mailing list by Brett Viren: https://lists.gnu.org/archive/html/emacs-orgmode/2014-01/msg00338.html.

Run the function org-export-json to export the current org-mode buffer to $file.org.json. You can then run org-toggl.py <config_path> <json_path> manually.

Changelog

  • [2020-03-06] #2: @DanielRichtmann Added Python 3 compatibility and fixed issue #1.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].