Package: hourly
HourlyHourly is a command-line time tracking tool for git projects. Hourly parses your commit messages forclock-inandclock-outkeywords to precisely estimate work hours. Designed for developers and project managers, hourly makes it easy to see how and where you spend your time. When configured with Stripe or BTCPay, hourly can generate invoices for your specified wage.UsageWork sessionsTo clock in:hourly-inThe above command updates the header of your work log (WorkLog.mdby default) and commits it with the message "clock-in".Stage any changes to your code base. When you are ready to commit:hourly commit.message="my commit message"Hourly updates the work log with your commit message. Feel free to use the work log to provide additional context.
When you are finished committing other work for this session, you may clock out:hourly-outAgain, hourly updates the work log and commits it with the message "clock-out" along with any other staged files. Readmore
about configuring your work log.TimesheetsWhen you are ready to generate a timesheet for your repo, run hourly from your git directory:hourly-reportHourly parses all the commit messages for clock in/out keywords and uses git's timestamps to determine how long each session lasted.For example, here's what happens when you run hourlyon the hourly repo itself:hourly-report repo.start_date="2018-10-21" repo.end_date="2019-3-10" repo.ignore="pro bono"pay period: 2018-10-28 13:44:48-04:00 -> 2019-02-25 12:49:51-05:00ignoring pro bonoTimeIn           LogIn                   TimeOut          LogOut TimeDelta     Hours0 2018-10-28 13:44:48-04:00        clock in 2018-10-28 13:56:35-04:00       clock out  00:11:47  0.1963891 2019-02-25 10:19:10-05:00  clock in T-1hr 2019-02-25 12:49:51-05:00  clock out T-5m  02:30:41  2.5113890 days 02:42:28, 2.71 hours workedTo save the timesheet as a csv file, include an ouput prefix:hourly-report repo.start_date="2018-10-21" repo.end_date="2019-3-10" repo.ignore="pro bono" report.filename=Pembrokepay period: 2018-10-28 13:44:48-04:00 -> 2019-02-25 12:49:51-05:00ignoring pro bonoTimeIn           LogIn                   TimeOut          LogOut TimeDelta     Hours0 2018-10-28 13:44:48-04:00        clock in 2018-10-28 13:56:35-04:00       clock out  00:11:47  0.1963891 2019-02-25 10:19:10-05:00  clock in T-1hr 2019-02-25 12:49:51-05:00  clock out T-5m  02:30:41  2.5113890 days 02:42:28, 2.71 hours workedwriting to file Pembroke-20181028-134448_to_20190225-124951.csvVisit theTutorialfor a detailed walk-through of how hourly generates timesheets.InvoicingTo generate an invoice using stripe:hourly-report invoice=stripe repo.start_date="Jan 1, 2020" stripe.customer.email=myclient@momandpop.comThe above command generates a time sheet for this repo, calculates earnings, prepares a stripe invoice,
and asks you to confirm details. After confirmation, an email will be sent from your Stripe account
tomyclient@momandpop.com.The btcpay invoicing is similar:hourly-report invoice=btcpay repo.start_date="Jan 1, 2020"After confirmation, hourly tells your btcpay server to generate an invoice and displays the corresponding payment url.
Note that BTCPay can be configured for lightning, so streaming payments are possible!Visit thePaymentssection for more info.Getting StartedHourly is hosted on github under the Apache 2.0 licensehttps://github.com/asherp/hourlyInstallpip install hourly --upgradeRequirementspandasgitpythonplotlyhydrastripe(optional)btcpay-python(optional)You can get these dependencies like this:pip install pandas gitpython plotlypip install hydra-core --upgradeFor invoicing:pip install btcpay-pythonpip install stripeFor hourly's docs:pip install mkdocs mkdocs-material markdown-include mknotebooksTestsFor integration tests, hourly may be tested against the hourly repo.Unit tests are based on pytest suite with pytest-covpip install pytest pytest-covTo run the tests, navigate to the base of this repo, thenpy.test tests.py --cov=hourlyConfigurationHourlyusesHydrafor customized configuration. The full options are given by hourly's
help command:hourly --helpA simple hour tracker for git projectsThis application helps users clock in and out of git repos,as well as generate timesheets for invoicing.Configure hourly to ignore commits by keyword or hashes== Configuration groups ==Compose your configuration from those groups (group=option)== Config ==Override anything in the config (foo.bar=value)commit:clock: nullidentity:- name- emailmessage: ''tminus: nullcompensation: []config_override: hourly.yamlinvoice: nullpayment: nullrepo:case_sensitive: falseend_date: nullerrant_clocks: []gitdir: .ignore: nullmatch_logs: falsestart_date: nullreport:currency: ''filename: nullpandas:display:max_columns: 10max_colwidth: 45max_rows: nullwidth: 600timesheet: truewage: nullwork: falsevis:frequency: 1 dplotly:figure:margin:pad: 0plot:animation_opts: nullauto_open: trueauto_play: trueconfig: nullfilename: hourly-work.htmlimage: nullimage_filename: plot_imageinclude_mathjax: cdninclude_plotlyjs: cdnlink_text: Export to plot.lyoutput_type: fileshow_link: falsevalidate: truework_log:bullet: '*'filename: WorkLog.mdheader_depth: 1Powered by Hydra (https://hydra.cc)Use --hydra-help to view Hydra specific helpHourly's default configuration including comments can be seen here.{!hourly/cli/conf/hourly.yaml !}Each of these can be overridden at runtime. For example,hourly commit.clock=in vis=null report.timesheet=FalseThis will update the WorkLog.md file and commit a clock-in message without visualizing or printing the timesheet.!!! notehourly-inis just syntactic sugar forhourly commit.clock=in vis=null report.timesheet=False.But if we want to override hourly's defaults without typing them in each time,
we can specify an hourly.yaml file in our git repo. Hourly will look
for this file (via theconfig_overrideoption) and override its default configuration.!!! note
Settings in your project'sconfig_overridecan still be overriden by command line arguments.An example of a custom override file is found in the top-level of the hourly repo:{!hourly.yaml !}A common use case would be permanently overriding the filename of the work_log you are committing against, to avoid
merge conflicts if multiple developers are working on the same project.