Last active
May 8, 2018 21:35
-
-
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i 2018/05/08 06:15 Some:Project | |
o 2018/05/08 09:00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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