{"id":16508087,"url":"https://github.com/romankornev/focus","last_synced_at":"2026-04-14T06:32:32.068Z","repository":{"id":253694239,"uuid":"64606287","full_name":"RomanKornev/Focus","owner":"RomanKornev","description":"Cross-platform tool that monitors time spent in different applications","archived":false,"fork":false,"pushed_at":"2019-01-21T12:18:51.000Z","size":712,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T02:47:14.504Z","etag":null,"topics":["analysis","analytics","cross-platform","crossplatform","ipython-notebook","jupyter-notebook","linux","notebook","plot","plotting","productivity","python","time-management","time-series","time-tracker","timeseries","timetracker","visualization"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RomanKornev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-07-31T17:25:39.000Z","updated_at":"2022-01-13T06:52:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"04612056-e67d-45ba-bf8e-579796075e8d","html_url":"https://github.com/RomanKornev/Focus","commit_stats":null,"previous_names":["romankornev/focus"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/RomanKornev/Focus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanKornev%2FFocus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanKornev%2FFocus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanKornev%2FFocus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanKornev%2FFocus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RomanKornev","download_url":"https://codeload.github.com/RomanKornev/Focus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanKornev%2FFocus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31785575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["analysis","analytics","cross-platform","crossplatform","ipython-notebook","jupyter-notebook","linux","notebook","plot","plotting","productivity","python","time-management","time-series","time-tracker","timeseries","timetracker","visualization"],"created_at":"2024-10-11T15:32:43.527Z","updated_at":"2026-04-14T06:32:32.052Z","avatar_url":"https://github.com/RomanKornev.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Focus\nA tool I wrote for myself to help me keep track of how much time I spend using different programs or browsing web.\n\nConsists of 2 parts: \n- Polling script for data gathering\n- Jupyter Notebook for analysis\n\n### Polling script\nThe polling script continuosly records current window in focus and saves it to ```./logs/``` as ```.json.gz```\n\nIt saves data such as pid, window name, process creation time, time in focus, executable path, command line arguments.\nEvery switch of a window is a new data point (to make a sequence plot described below).\n\nIt also filters any idle time into a different data group and has keywords that won't set the idle timer.\n\nIf it lacks permissions or another error occurs, it will put window names with traceback in error log.\n\n### Notebook\nThe notebook `Focus.ipynb` looks like this:\n\n![Sequence](https://user-images.githubusercontent.com/5807561/51444553-01e25780-1d0a-11e9-944b-aac96b62d221.png)\n\nIt categorizes every data point by ```window_name``` and ```exe``` using custom ```OrderedDict``` tables.\n\nDifferent plots are available:\n- ```plot_day_sequence_chart``` similar to [Gantt chart](https://en.wikipedia.org/wiki/Gantt_chart) but with top ```N``` categories (above picture).\n- ```plot_top_categories``` plots top ```N``` categories of all time.\n- ```plot_top_by_date``` same as above but splits each category by days.\n- ```plot_category_by_day``` plots one category usage each day.\n- ```plot_timeline_by_category_time``` same as above but for top ```N``` categories.\n\n## Installation\nI recommend using [Anaconda](https://www.continuum.io/downloads)\n### For the polling script\nTo install necessary components for the polling script:\n```\nconda install psutil ujson\n```\n#### Additiinal components\n\nIf on Windows:\n```\nconda install pywin32\n```\nIf on Linux:\n```\nsudo apt-get install xprintidle xdotool\n```\n#### Autostart\n##### Windows\nTo run the logging script on startup, put a shortcut of the script `focus_bg.pyw` into `C:\\Users\\USERNAME\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\` .\n\n##### Linux: \n```\ncrontab -e\n@reboot python /path/to/focus_bg.pyw\n```\n### For the notebook\n```\nconda install pandas seaborn\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromankornev%2Ffocus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromankornev%2Ffocus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromankornev%2Ffocus/lists"}