{"id":15014640,"url":"https://github.com/wakatime/repl-python-wakatime","last_synced_at":"2025-04-09T19:23:34.600Z","repository":{"id":65210173,"uuid":"587877815","full_name":"wakatime/repl-python-wakatime","owner":"wakatime","description":"Python REPL plugin for automatic time tracking and metrics generated from your programming activity.","archived":false,"fork":false,"pushed_at":"2025-04-07T17:30:51.000Z","size":99,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-07T18:38:16.813Z","etag":null,"topics":["ipython","plugin","ptpython","python","wakatime"],"latest_commit_sha":null,"homepage":"https://repl-python-wakatime.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wakatime.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"user?u=83975719","custom":["https://user-images.githubusercontent.com/32936898/199681341-1c5cfa61-4411-4b67-b268-7cd87c5867bb.png","https://user-images.githubusercontent.com/32936898/199681363-1094a0be-85ca-49cf-a410-19b3d7965120.png","https://user-images.githubusercontent.com/32936898/199681368-c34c2be7-e0d8-43ea-8c2c-d3e865da6aeb.png"]}},"created_at":"2023-01-11T19:54:13.000Z","updated_at":"2025-01-18T03:30:30.000Z","dependencies_parsed_at":"2024-01-29T19:13:26.604Z","dependency_job_id":"c370087c-15ed-4881-8546-013eaf0484f2","html_url":"https://github.com/wakatime/repl-python-wakatime","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"1e65b89a47b35c1121bb4bdddc13d573f76aa16c"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakatime%2Frepl-python-wakatime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakatime%2Frepl-python-wakatime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakatime%2Frepl-python-wakatime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakatime%2Frepl-python-wakatime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wakatime","download_url":"https://codeload.github.com/wakatime/repl-python-wakatime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248096021,"owners_count":21046963,"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":["ipython","plugin","ptpython","python","wakatime"],"created_at":"2024-09-24T19:45:53.088Z","updated_at":"2025-04-09T19:23:34.564Z","avatar_url":"https://github.com/wakatime.png","language":"Python","funding_links":["https://patreon.com/user?u=83975719","https://user-images.githubusercontent.com/32936898/199681341-1c5cfa61-4411-4b67-b268-7cd87c5867bb.png","https://user-images.githubusercontent.com/32936898/199681363-1094a0be-85ca-49cf-a410-19b3d7965120.png","https://user-images.githubusercontent.com/32936898/199681368-c34c2be7-e0d8-43ea-8c2c-d3e865da6aeb.png"],"categories":[],"sub_categories":[],"readme":"# repl-python-wakatime\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/wakatime/repl-python-wakatime/main.svg)](https://results.pre-commit.ci/latest/github/wakatime/repl-python-wakatime/main)\n[![github/workflow](https://github.com/wakatime/repl-python-wakatime/actions/workflows/main.yml/badge.svg)](https://github.com/wakatime/repl-python-wakatime/actions)\n[![codecov](https://codecov.io/gh/wakatime/repl-python-wakatime/branch/main/graph/badge.svg)](https://codecov.io/gh/wakatime/repl-python-wakatime)\n[![readthedocs](https://shields.io/readthedocs/repl-python-wakatime)](https://repl-python-wakatime.readthedocs.io)\n\n[![github/downloads](https://shields.io/github/downloads/wakatime/repl-python-wakatime/total)](https://github.com/wakatime/repl-python-wakatime/releases)\n[![github/downloads/latest](https://shields.io/github/downloads/wakatime/repl-python-wakatime/latest/total)](https://github.com/wakatime/repl-python-wakatime/releases/latest)\n[![github/issues](https://shields.io/github/issues/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/issues)\n[![github/issues-closed](https://shields.io/github/issues-closed/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/issues?q=is%3Aissue+is%3Aclosed)\n[![github/issues-pr](https://shields.io/github/issues-pr/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/pulls)\n[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/pulls?q=is%3Apr+is%3Aclosed)\n[![github/discussions](https://shields.io/github/discussions/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/discussions)\n[![github/milestones](https://shields.io/github/milestones/all/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/milestones)\n[![github/forks](https://shields.io/github/forks/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/network/members)\n[![github/stars](https://shields.io/github/stars/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/stargazers)\n[![github/watchers](https://shields.io/github/watchers/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/watchers)\n[![github/contributors](https://shields.io/github/contributors/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/graphs/contributors)\n[![github/commit-activity](https://shields.io/github/commit-activity/w/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/graphs/commit-activity)\n[![github/last-commit](https://shields.io/github/last-commit/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/commits)\n[![github/release-date](https://shields.io/github/release-date/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/releases/latest)\n\n[![github/license](https://shields.io/github/license/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/blob/main/LICENSE)\n[![github/languages](https://shields.io/github/languages/count/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)\n[![github/languages/top](https://shields.io/github/languages/top/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)\n[![github/directory-file-count](https://shields.io/github/directory-file-count/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)\n[![github/code-size](https://shields.io/github/languages/code-size/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)\n[![github/repo-size](https://shields.io/github/repo-size/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)\n[![github/v](https://shields.io/github/v/release/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)\n\n[![pypi/status](https://shields.io/pypi/status/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#description)\n[![pypi/v](https://shields.io/pypi/v/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#history)\n[![pypi/downloads](https://shields.io/pypi/dd/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)\n[![pypi/format](https://shields.io/pypi/format/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)\n[![pypi/implementation](https://shields.io/pypi/implementation/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)\n[![pypi/pyversions](https://shields.io/pypi/pyversions/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)\n\nPython REPL plugin for automatic time tracking and metrics generated from your\nprogramming activity.\n\n![screenshot](https://github.com/wakatime/repl-python-wakatime/assets/32936898/d0ac2fab-f9c2-4213-99e3-4249279b1213)\n\nSupported REPLs:\n\n- [x] [python](https://github.com/python/cpython):\n  - executes\n    [`str(sys.ps1)`](https://docs.python.org/3/library/sys.html#sys.ps1) after\n    every input.\n  - configure file:\n    [`$PYTHON_STARTUP`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP).\n\n```python\nfrom repl_python_wakatime.python import install_hook\n\ninstall_hook()\n```\n\n- [x] [ptpython](https://github.com/prompt-toolkit/ptpython):\n  - executes `get_ptpython().get_output_prompt()` after every output.\n  - configure file: `.../ptpython/config.py`. `...` depends on OS.\n\n```python\nfrom ptpython.repl import PythonRepl\nfrom repl_python_wakatime.ptpython import install_hook\n\n\ndef configure(repl: PythonRepl) -\u003e None:\n    install_hook(repl)\n```\n\n- [x] [ipython](https://github.com/ipython/ipython):\n  - executes\n    `c.TerminalInteractiveShell.prompts_class(shell).out_prompt_tokens()` after\n    every output.\n  - configure file: `~/.ipython/profile_default/ipython_config.py`.\n\n```python\nfrom repl_python_wakatime.iptpython import install_hook\n\ninstall_hook(c)\n```\n\n- [x] [ptipython](https://github.com/prompt-toolkit/ptpython): Same as\n  [ipython](https://github.com/ipython/ipython).\n- [ ] [bpython](https://github.com/bpython/bpython)\n- [ ] [xonsh](https://github.com/xonsh/xonsh)\n- [ ] [mypython](https://github.com/asmeurer/mypython): Won't fix.\n  - configure file: non-exist.\n\n`install_hook()` must be after the customization of the prompt string and best\nat the end of file.\n\n## Configure\n\n```python\nfrom repl_python_wakatime.python import install_hook\n\ninstall_hook(hook_function, args, kwargs)\n```\n\nwill execute `hook_function(*args, **kwargs)` after every output/input. Other\nREPLs are similar. Currently, `hook_function` can be:\n\n- `repl_python_wakatime.hooks.wakatime.wakatime_hook()`: By default.\n- `repl_python_wakatime.hooks.codestats.codestats_hook()`: for [codestats](https://codestats.net/)\n- Create your hooks for other similar projects, such as:\n  - [codetime](https://codetime.dev/)\n  - [rescuetime](https://www.rescuetime.com/)\n  - ...\n\n## Related programs\n\nSome programs is written in python or providing a python port.\nWe can use this project to statistic their time:\n\n- [gdb](https://sourceware.org/gdb): See\n  [here](https://github.com/Freed-Wu/gdb-prompt)\n\n## Similar projects\n\n- [wakatime plugins for python and many shells](https://wakatime.com/terminal)\n- [codestats plugins](https://codestats.net/plugins)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwakatime%2Frepl-python-wakatime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwakatime%2Frepl-python-wakatime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwakatime%2Frepl-python-wakatime/lists"}