Skip to content
Python API for
Latest commit c25fd3c Feb 22, 2015 @lann Update README.rst
Failed to load latest commit information.
LICENSE Added license Aug 2, 2010
MANIFEST First Commit Aug 2, 2010
README.rst Treat entries of type 'dateTime' as datetime Oct 2, 2014 changed requires to install_requires to accomodate setuptools Feb 3, 2015


This project is no longer actively maintained.

This one is (as of this writing): lionheart/python-harvest

Harvest API


from datetime import datetime, timedelta
from harvest import Harvest

h = Harvest( '', '', 'mypassword' )
user = h.find_user( 'John', 'Doe' )
if user:
        print 'The user ID = %d' %

        start =
        end = start + timedelta(7)

        total = 0
        for entry in user.entries( start, end ):
                total += entry.hours

        print 'Total hours worked = %f' % total


import sys
from harvest import Harvest, HarvestError
from datetime import datetime, timedelta
import time

URI = ''
EMAIL = ''
PASS = 'xxxxxx'

h = Harvest(URI,EMAIL,PASS)

while True:
        total = 0
        dose = 0

        start = hour=0, minute=0, second=0 )
        end = start + timedelta(1)
                for user in h.users():
                        for entry in user.entries( start, end ):
                                total += entry.hours

                text = '%0.02f' % total
                print text

        except HarvestError:
                print 'Retrying in 5 minutes...'



for project in h.projects:
        print project
        print project.client
        for assignment in project.task_assignments:
                print '\t',assignment
        for entry in project.entries:
                print '\t',entry
                print '\t\ttask:',entry.task


for client in h.clients:
        print client
        for contact in client.contacts:
                print '\t',contact
Something went wrong with that request. Please try again.