{"id":20838468,"url":"https://github.com/reload/harvestdata","last_synced_at":"2025-05-08T20:37:56.298Z","repository":{"id":137511269,"uuid":"1806664","full_name":"reload/harvestdata","owner":"reload","description":"Retrieves data from Harvest and prepares it for Geckoboard","archived":false,"fork":false,"pushed_at":"2018-02-08T22:15:51.000Z","size":196,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-31T18:03:49.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reload.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-05-26T21:11:31.000Z","updated_at":"2021-02-20T09:33:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"2896f211-9c3d-475c-8a4b-7763c9351643","html_url":"https://github.com/reload/harvestdata","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fharvestdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fharvestdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fharvestdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fharvestdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reload","download_url":"https://codeload.github.com/reload/harvestdata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253146720,"owners_count":21861452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T01:10:23.998Z","updated_at":"2025-05-08T20:37:56.277Z","avatar_url":"https://github.com/reload.png","language":"PHP","readme":"# HarvestData\n\nHarvestData is a console application which fetches data Harvest and stores it in a file in a format prepared for [Custom Widgets](http://support.geckoboard.com/forums/207979-geckoboard-api) in [Geckoboard](http://geckoboard.com). \n\nHarvestData currently supports the time tracking system [Harvest](http://harvestapp.com), and, hence the name, it will probably stay that way :-)\n\nHarvestData has been developed by [Reload](http://reload.dk) and the source code can be found on [GitHub](https://github.com/reload/harvestdata).\n\n## This is how Reloads financial geckoboard looks like\n\n![Financial geckoboard](https://github.com/reload/harvestdata/raw/master/docs/Geckoboard-HarvestData.jpg \"Snapshot of Reloads financial Geckoboard\")\n\nQuick reference examples:\n\n1. \u003ccode\u003e./harvestdata compare --date-from=\"-8 days\" --date-to=\"yesterday\" --chart-type=numberstatbudget --output-file=stat1.xml\u003c/code\u003e\n2. \u003ccode\u003e./harvestdata data --date-from=\"-8 days\" --date-to=\"yesterday\" --chart-type=piechart --chart-period=day --output-file=piechart2.js\u003c/code\u003e\n3. \u003ccode\u003e./harvestdata data --date-from=\"-8 days\" --date-to=\"yesterday\" --chart-type=columnspline --output-file=columnspline3.js\n4. Same as 1, just another timespan\n5. Same as 1, just another timespan\n6. Same as 1, just another timespan\n7. \u003ccode\u003e./harvestdata data --date-from=\"-5 mondays\" --date-to=\"sunday last week\" --chart-type=columnspline --chart-period=week --output-file=columnspline7.js\u003c/code\u003e\n8. \u003ccode\u003e./harvestdata billable --chart-type=geekometer --date-from=\"last weekday\" --date-to=\"last weekday\" --output-file=geekometer8.xml\u003c/code\u003e\n9. Same as 8, but using \"2 weekdays ago\" as date-from and date-to\n10. \u003ccode\u003e./harvestdata data --date-from=\"first day of 6 months ago\" --date-to=\"last day of last month\" --chart-type=columnspline --chart-period=month --output-file=columnspline10.js\u003c/code\u003e\n11. Same as 2, just another timespan\n12. Same as 2, just another timespan\n13. Same as 2, just another timespan\n\nDetailed explanation of the parameters and commands can be found below.\n\n\n## Installation\n\nClone the repository on [GitHub](https://github.com/reload/harvestdata).\n\nCURL and **PHP 5.3** must be installed (5.2 won't cut it!).\nYou might need to change the *#!* path in the \"HarvestData\" file. Use \"*which php*\" in the commandline in order to find the proper path.\n\n## Configuration\n\nHarvestData needs to know where and how to access the systems involved. This configuration is handled by a config.yml file. Copy the provided config.sample.yml and update it with account information. If your configuration file is not located in the root directory you can specify the path to the config file using the \u003ccode\u003e--config\u003c/code\u003e option.\n\n## Usage\n\nHarvestData works by looping through all entries made by users (defaulting to employees) and fetching the data for presentation.\n\nA time period can be specified using the \u003ccode\u003e--date-from\u003c/code\u003e and/or \u003ccode\u003e--date-to\u003c/code\u003e options - use a date in the *YYYYMMDD* format, or use \"yesterday\" or similar [PHP-parsable dates](http://www.php.net/manual/en/datetime.formats.relative.php) (see examples below).\n\nFor outputting we have a couple of different parameters.\nYou can use \u003ccode\u003e--chart-type\u003c/code\u003e in order to define which kind of chart the data should be outputted as.\nThis is used in conjunction with \u003ccode\u003e--chart-period\u003c/code\u003e which is used for grouping the data in the chart. Currently the following values are generally supported:\n\n- day\n- week\n- month \n\nThe filename of the output can be defined as well, use the \u003ccode\u003e--output-file\u003c/code\u003e parameter for this. Existing files will be overwritten. See examples later on.\n\nYou can also use the \u003ccode\u003e--days-back\u003c/code\u003e option, requiring an integer.\nIf no dates are set, the system will use todays date and X days back as defined in the config file (that can differ in each Command).\n\nHarvestData will exclude time entries from contractors by default. Change this behaviour by adding the follow parameter:\n\u003ccode\u003e--exclude-contractors=false\u003c/code\u003e or change it in the config file.\n\n### General commandline options (all are optional)\n\n\u003ccode\u003e--date-to\u003c/code\u003e: 'Date from in YYYYMMDD format (or anything php parsable). Date is inclusive. Today is default.'\n\n\u003ccode\u003e--date-from\u003c/code\u003e: 'Date from in YYYYMMDD format (or anything php parsable). Date is inclusive. DaysBack from config is default.'\n\n\u003ccode\u003e--output-file\u003c/code\u003e: 'Output filename. Will default to a datetime-stamp.'\n\t\t\n\u003ccode\u003e--chart-type\u003c/code\u003e: 'Chart-type when outputting data. Only usable for FetchBillable and FetchData. See their descriptions for possible values.'\n\n\u003ccode\u003e--chart-period\u003c/code\u003e: 'Chart period when outputting data. Only usable for FetchBillable and FetchData. E.g.: day, week or month'\n\n\u003ccode\u003e--exclude-contractors\u003c/code\u003e: 'Exclude contractors hours from the retrieved dataset. Default is true. Boolean value required.'\n\n\u003ccode\u003e--config\u003c/code\u003e: 'Path to the configuration file. Default is config.yml'\n\n\u003ccode\u003e--days-back\u003c/code\u003e: 'Overwrite the config setting. Calculate the from-date by X daysback subtracted from to-date. DEPRECATED as of 0.5.'\n\n\u003ccode\u003e--harvest-project\u003c/code\u003e: 'One or more Harvest projects (id, name or code) separated by , (comma). Use \"all\" for all projects or \"active\" for the active ones. DEPRECATED as of 0.5. Might be reintroduced later.'\n\n### Run it\n\nRun \u003ccode\u003e./harvestdata\u003c/code\u003e from the command line to show all available commands.\n\nHarvestData currently supports three use cases: \n\n### Fetch Entries\n**_Fetch entries in Harvest_**\n\nAs of the current version 0.5 it will be outputted as a Geckoboard [text-widget](http://support.geckoboard.com/entries/231507-custom-widget-type-definitions).\nWe use this command for showing the latest 30 Harvest entries from our employees and contractors, displaying them on a status Geckoboard. \n\n#### Examples:\n\u003ccode\u003e./harvestdata entries --exclude-contractors=false --output-file=today.xml\u003c/code\u003e\n\n \n### Fetch Billable \n**_Fetch number of billable hours from Harvest in a specified period_**\n\nSupported chart-type methods:\n\n- **geekometer** ([built-in Geckoboard widget](http://support.geckoboard.com/entries/274940-custom-chart-widget-type-definitions))\n- **line** ([built-in Geckoboard widget](http://support.geckoboard.com/entries/274940-custom-chart-widget-type-definitions))\n\n#### Examples:\nFetch all billable data from september 9th 2011:\n \n\u003ccode\u003e./harvestdata billable --date-from=20110901 --date-to=20110901\u003c/code\u003e\n\nFetch all billable data from september 9th 2011 and export the data in \"geekometer\" chart-type format:\n\n\u003ccode\u003e./harvestdata billable --date-from=20110901 --date-to=20110901 --chart-type=geekometer\u003c/code\u003e\n\n\n\n### Fetch Data \n**_Fetch detailed data_**\nThis is probably the most versatile command.\n\nSupported chart-type methods:\n\n- **singlecolumn** ([custom highcharts widget](http://support.geckoboard.com/entries/274940-custom-chart-widget-type-definitions)) Show a single column chart, often just billable hours\n- **columnspline** ([custom highcharts widget](http://support.geckoboard.com/entries/274940-custom-chart-widget-type-definitions)) Same as singlecolumn, but with a budget spline overlay\n- **stackedcolumn** ([custom highcharts widget](http://support.geckoboard.com/entries/274940-custom-chart-widget-type-definitions)) Shows billable and non-billable bars in a stacked format\n- **piechart** ([custom highcharts widget](http://support.geckoboard.com/entries/274940-custom-chart-widget-type-definitions)) Well, a piechart with billable vs non-billable data\n\n\n#### Examples\n\nFetch data from the last 7 days, output it as the chart \"singlecolumn\" and output it in the file \"singlecolumn.js\":\n\n\u003ccode\u003e./harvestdata data --date-from=\"-8 days\" --date-to=\"yesterday\" --chart-type=singlecolumn --chart-period=day --output-file=singlecolumn.js\u003c/code\u003e\n\nFetch data from the last 4 whole weeks (monday to sunday) group it by week, draw it as chart \"stackedcolumn\" and output it as the file \"stackedcolumn-week.js\"\n\n\u003ccode\u003e./harvestdata data --date-from=\"-5 mondays\" --date-to=\"sunday last week\" --chart-type=stackedcolumn --chart-period=week --output-file=stackedcolumn-week.js\u003c/code\u003e\n\nAnd a couple of more examples. Note the chart-period and the clever date values:\n\n\u003ccode\u003e./harvestdata data --date-from=\"first day of 6 months ago\" --date-to=\"last day of last month\" --chart-type=stackedcolumn --chart-period=month --output-file=stackedcolumn-sixmonths.js\u003c/code\u003e\n\n\u003ccode\u003e./harvestdata data --date-from=\"first day of january\" --date-to=\"last day of last month\" --chart-type=singlecolumn --chart-period=month --output-file=year-single.js\u003c/code\u003e\n\n### Compare Periods \n**_Compare billable hours between the assigned period and the same number of days before or the defined budget_**\n\nSupported chart-type methods:\n\n- **numberstat** ([built-in Geckoboard widget](http://support.geckoboard.com/entries/231507-custom-widget-type-definitions)) Shows a number and a percentage (difference between the two provided numbers). The main number is billable hours in the defined period, and the percentage is the difference compared to the previous number of days.\n- **numberstatbudget** ([built-in Geckoboard widget](http://support.geckoboard.com/entries/231507-custom-widget-type-definitions)) Will display billable hours in the chosen period compared to the defined budget.\n\n\n#### Examples:\nCompare billable hours from yesterday with billable hours the previous day (two days ago):\n \n\u003ccode\u003e./harvestdata compare --date-from=\"yesterday\" --date-to=\"yesterday\"\u003c/code\u003e\n\n# Developer notes\nAt lot of stuff is rather hardcoded right now, quite a bit of the classes are ripe for refactoring. As it works for our usecases it might take a while before we fix this stuff.\n\nAlso, take a look at docs/todo.txt and docs/test.txt\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fharvestdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freload%2Fharvestdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fharvestdata/lists"}