Package: ganttlogger
GanttLoggerCLI that Monitors active-tab, mouse-distance and keyboard-count, Logs and Plots various graphs.(PyPI)https://pypi.org/project/ganttlogger/README - 日本語版AGENDARequirements(Test Completing)Get StartedInstallWindowsMacOSQuick StartStructure of outputed folder "ganttlogger_logs"Command OptionsaloneobserverloggerplotterdisplayermergerIssuesIn the future...LicenseRequirements(Test Completing)▲OSWindows10(64bit)MacOS High Sierra ~Python3.6.x3.7.xGet Started▲Install▲WindowsThere are two ways to install.Install withpip.Install python3.Install withpiplike below.> python -m pip install ganttloggerInstall by downloadingganttlogger-exe-x86_64-<version>.zip.Read README for executable file.In English日本語版MacOSThere are two ways to install.Install withpip.Install python3 and pip3.Installl withpip3like below.$ pip3 install ganttloggerIf you can't install withpip3, downloadganttlogger-<version>.tar.gzfromReleasesorPyPI, extract it, and run install command below.$ python3 setup.py installAdd "Terminal.app" to "Accessibility" in "Security & Privacy" in system environment settings to allow Terminal.app to get inputs from keyboard.Install by downloadingganttlogger-exe-macos-<version>.zip.Read README for executable file.In English日本語版Quick Start▲Run as "Alone"(Run both monitoring and logging in a PC).$ ganttloggerExit CLI(running as "Alone" or "Observer")by hitting keys1+0+z+mcontinuously (mashing keys, not long pressing simultaneously).Check a created folderganttlogger_logsin current directory.When you want a guide about the outputed folder, referStructure of outputed folder "ganttlogger_logs".If you get the following problemsModuleNotFoundError: No module named 'win32gui'on Windows.Try uninstall and installpywin32.> python -m pip uninstall pywin32 & python -m pip install pywin32Appear warning below when plotting graphs./usr/local/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py:211: RuntimeWarning: Glyph 128266 missing from current font.
font.set_text(s, 0.0, flags=flags)
/usr/local/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py:180: RuntimeWarning: Glyph 128266 missing from current font.
font.set_text(s, 0, flags=flags)No problem. You can ignore that.Structure of outputed folder "ganttlogger_logs"▲ganttlogger_logs
├ (ID)
    ├ active_tab.log
    ├ mouse.log
    ├ keyboard.log
    └ graphs
        ├ output_(date)_all.pkl
        ├ output_(date)_all.png
        ...
├ (ID)
    ├ active_tab.log
    ...
...(ID): A unique ID generated by ganttlogger.~.log: log data.~.pkl: Dynamic graph data.~.png: Static graph data(image).Command Options▲usage: ganttlogger [--observer] [--logger] [--uuid <UUID>] [--help] [--plotter] [--withplot] [--displayer] [--merger]

This CLI will do Observing active-tab, mouse, keyboard,
and Logging them,
and Plotting graphs (active-tab=ganttchart, mouse=line, keyboard=bar).
If you don't set any option, this work both of 'observer' and 'logger'.

optional arguments:
  -h, --help            show this help message and exit
  -o, --observer        The role of this PC is only observing action.
  -l, --logger          The role of this PC is only logging and plotting. You must also set '--uuid'.
  -u UUID, --uuid UUID  When you set '--logger', you must also set this by being informed from 'observer' PC.
  -p, --plotter         Use this option if you want other outputs by a log in the current directory after getting one and a graph.
  --withplot            Use this option when you want to get a graph after running 'Alone'.
  -d, --displayer       Use this option when you want to look a graph from a '.pkl' file.
  -m, --merger          Use this option when you want to merge all logs in folders in 'ganttlogger_logs'.--observerand--loggerdon't work because they're not implemented yet.Runganttloggerwithout any options if you run CLI asalone- both ofobserverandlogger/plotter-.Add an option--withplot, if you want graphs along with logs.Then, CLI will output a graph like No.1 ofGraph ExamplesChange to current directory of logs and add an option--plotter, if you want to get other graphs from logs.Then, you'll be required some settings to decide formats to plot graphs.First,Select plot types separated by ',',  or enter without input.:Select keywords(you can combine) from (set_interval | filter_tab | select_data | xaxis_type | xlim_range).When selectset_interval, you'll be required a setting.Set the number of interval by seconds:Example graph when set "5" is No.2 ofGraph Examples.When selectfilter_tab, you'll be required two settings.(1)Input a file name written a list of tab text you want to filter.:

(2)Do you want to hide mouse and keyboard graph depictions of the duration filtered regarding tab text?(Y/n) :When selectselect_data, you'll be required a setting.Select 'all' or names separated by ',' from ('active_tab'|'mouse'|'keyboard'|'mouse-keyboard').:Example graphs when set "active_tab" and "keyboard" are No.5 and No.6 ofGraph Examples.When selectxaxis_type, you'll be required two settings.(1)Select x-axis type for ActiveTab from whether 'active-start' or number of the interval by seconds:

(2)Select x-axis type for Mouse or Keyboard from whether 'active-start' or number of the interval by seconds:Example graphs when set "(1)active-start(2)active-start" and "(1)15(2)15" are No.3 and No.4 ofGraph Examples.When selectxlim_range, you'll be required two settings.(1)Input start time of graph xlim in the format 'YYYY/mm/dd HH:MM:SS'.:

(2)Input end time of graph xlim in the format 'YYYY/mm/dd HH:MM:SS'.:Then, you can get a graph during the specified time zone.When selectset_ylabel, you'll be required a setting.Do you want to remove from active-tab-names(y-labels)? (Y/n):If you input 'Y', you can get graphs having y-labels composed of the only application names (excluding tab names).Add an option--displayerif you want watch dynamic graph with generated~.pkl.Then, you'll be required a setting.Input file name of '.pkl':Add an option--mergerif you want to merge all logs in folders(these names is ID) in "ganttlogger_logs".Then, you'll be required a setting.Select 'all' or names separated by ',' from ('active_tab'|'mouse'|'keyboard').:After running, you'll get an outputted folder "merged_<datetime>".Graph ExamplesAll graphs were plottedfrom same logs.Issues.▲When long running on Mac, this cli makes PC out of memory.The reason may be in a dependent modulepyobjc, but I don't know how to release memory.Memory leak pyobjc - stack overflowLike No.2 inGraph Examples, a part of ganttchart disappear from graph when settingset_intervalmore than 2.I'm investigating the causes...InObserver.py, sometimes thread error like below occurs on Windows. I'm investigating the causes...Exception in thread Thread-1:
Traceback (most recent call last):
...Sometimes an error below occurs when plotting from a short term logs.Traceback (most recent call last):
    File "/usr/local/bin/ganttlogger", line 10, in <module>
        sys.exit(main())
    File "/usr/local/lib/python3.7/site-packages/ganttlogger/app.py", line 42, in main
        plotter.start()
    File "/usr/local/lib/python3.7/site-packages/ganttlogger/modules/Plotter.py", line 248, in start
        self.run()
    File "/usr/local/lib/python3.7/site-packages/ganttlogger/modules/Plotter.py", line 272, in run
        self.get_mouse()
    File "/usr/local/lib/python3.7/site-packages/ganttlogger/modules/Plotter.py", line 691, in get_mouse
        current_time = self.plot_active_tab[0][0].replace(microsecond=0)
IndexError: index 0 is out of bounds for axis 0 with size 0Try implementing flushing stdin buffering. But it's difficury, so I want advices or pull-requests.In the future...▲Implement mode remote '--observer' and '--logger'.License▲MIT LICENSE.