Skip to content

Instantly share code, notes, and snippets.

@zoranzaric
Last active May 8, 2018 21:35
Show Gist options
  • Save zoranzaric/f72b324a18ab7588f4fc68f6e436c9e5 to your computer and use it in GitHub Desktop.
Save zoranzaric/f72b324a18ab7588f4fc68f6e436c9e5 to your computer and use it in GitHub Desktop.
Run with: hledger -f example.timedot bal -O csv -p tomorrow -N | python timeclock.py "2018/05/08"
i 2018/05/08 06:15 Some:Project
o 2018/05/08 09:00
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import sys
import csv
if __name__ == '__main__':
date = sys.argv[1]
csvreader = csv.DictReader(sys.stdin, delimiter=",")
for row in csvreader:
account = ":".join(row['account'].split('.'))
balance = row['balance'].replace('.', ',')
print """{date} * Foobar
{account} {balance} h
Equity:Workday -7,7 h
Assets:Receivables:Overtime
""".format(date=date,
account=account,
balance = balance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment