repl-python-wakatime


Namerepl-python-wakatime JSON
Version 0.1.6 PyPI version JSON
download
home_pageNone
SummaryPython REPL plugin for automatic time tracking and metrics generated from your programming activity
upload_time2025-10-09 06:34:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseGPL v3
keywords wakatime plugin python ipython ptpython
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # repl-python-wakatime

[![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)
[![github/workflow](https://github.com/wakatime/repl-python-wakatime/actions/workflows/main.yml/badge.svg)](https://github.com/wakatime/repl-python-wakatime/actions)
[![codecov](https://codecov.io/gh/wakatime/repl-python-wakatime/branch/main/graph/badge.svg)](https://codecov.io/gh/wakatime/repl-python-wakatime)
[![readthedocs](https://shields.io/readthedocs/repl-python-wakatime)](https://repl-python-wakatime.readthedocs.io)

[![github/downloads](https://shields.io/github/downloads/wakatime/repl-python-wakatime/total)](https://github.com/wakatime/repl-python-wakatime/releases)
[![github/downloads/latest](https://shields.io/github/downloads/wakatime/repl-python-wakatime/latest/total)](https://github.com/wakatime/repl-python-wakatime/releases/latest)
[![github/issues](https://shields.io/github/issues/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/issues)
[![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)
[![github/issues-pr](https://shields.io/github/issues-pr/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/pulls)
[![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)
[![github/discussions](https://shields.io/github/discussions/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/discussions)
[![github/milestones](https://shields.io/github/milestones/all/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/milestones)
[![github/forks](https://shields.io/github/forks/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/network/members)
[![github/stars](https://shields.io/github/stars/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/stargazers)
[![github/watchers](https://shields.io/github/watchers/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/watchers)
[![github/contributors](https://shields.io/github/contributors/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/graphs/contributors)
[![github/commit-activity](https://shields.io/github/commit-activity/w/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/graphs/commit-activity)
[![github/last-commit](https://shields.io/github/last-commit/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/commits)
[![github/release-date](https://shields.io/github/release-date/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/releases/latest)

[![github/license](https://shields.io/github/license/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime/blob/main/LICENSE)
[![github/languages](https://shields.io/github/languages/count/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)
[![github/languages/top](https://shields.io/github/languages/top/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)
[![github/directory-file-count](https://shields.io/github/directory-file-count/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)
[![github/code-size](https://shields.io/github/languages/code-size/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)
[![github/repo-size](https://shields.io/github/repo-size/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)
[![github/v](https://shields.io/github/v/release/wakatime/repl-python-wakatime)](https://github.com/wakatime/repl-python-wakatime)

[![pypi/status](https://shields.io/pypi/status/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#description)
[![pypi/v](https://shields.io/pypi/v/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#history)
[![pypi/downloads](https://shields.io/pypi/dd/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)
[![pypi/format](https://shields.io/pypi/format/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)
[![pypi/implementation](https://shields.io/pypi/implementation/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)
[![pypi/pyversions](https://shields.io/pypi/pyversions/repl-python-wakatime)](https://pypi.org/project/repl-python-wakatime/#files)

Python REPL plugin for automatic time tracking and metrics generated from your
programming activity.

![screen](https://github.com/user-attachments/assets/4e337cae-06a7-4164-be83-c7b73e8a0f63)

## REPLs

### [python](https://github.com/python/cpython)

[`$PYTHON_STARTUP`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP):

```python
import sys

from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.python import Python

sys.ps1 = Python(Wakatime())
```

### [ptpython](https://github.com/prompt-toolkit/ptpython)

`${XDG_CONFIG_HOME:-$HOME/.config}/ptpython/config.py`:

```python
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.ptpython import Ptpython


def configure(repl: PythonRepl) -> None:
    repl.all_prompt_styles[repl.prompt_style] = Ptpython(
        Wakatime(), repl.all_prompt_styles[repl.prompt_style]
    )
```

### [ipython](https://github.com/ipython/ipython)/[ptipython](https://github.com/prompt-toolkit/ptpython)

`~/.ipython/profile_default/ipython_config.py`:

```python
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.ipython import Ipython

c.TerminalInteractiveShell.prompts_class = lambda *args, **kwargs: Ipython(
    Wakatime(),
    c.TerminalInteractiveShell.prompts_class(*args, **kwargs),
)
```

### [gdb](https://sourceware.org/gdb/)

Your `gdb` must be compiled with
[python port](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Python.html).

`~/.config/gdb/gdbinit`:

```gdb
source ~/.config/gdb/gdbinit.py
```

`~/.config/gdb/gdbinit.py`:

```python
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.gdb import StopHook

StopHook(Wakatime())
```

- [ ] [bpython](https://github.com/bpython/bpython)
- [ ] [xonsh](https://github.com/xonsh/xonsh)
- [ ] [mypython](https://github.com/asmeurer/mypython): won't fix due to no any
  configuration.
- [ ] vim/neovim with python support: see
  [vim-wakatime](https://github.com/wakatime/vim-wakatime) and
  [code-stats.nvim](https://github.com/Freed-Wu/code-stats.nvim)

## Hooks

- [x] [wakatime](https://wakatime.com/)
- [x] [codestats](https://codestats.net/)
- [ ] [codetime](https://codetime.dev/)
- [ ] [rescuetime](https://www.rescuetime.com/)

You can use many hooks at the same time:

```python
from repl_python_wakatime.backends.chainedhook import ChainedHook
from repl_python_wakatime.backends.codestats import CodeStats
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.python import Python

sys.ps1 = Python(ChainedHook(hooks=(Wakatime(), CodeStats())))
```

## APIs

You can use this project to statistic the time of using any programs. Such as,
[translate-shell](https://github.com/Freed-Wu/translate-shell/) is a translating
program:

```python
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends import Repl

repl = Repl(Wakatime(language="translate-shell", category="translating"))
# after each translating
repl()
```

## Similar projects

- [wakatime plugins for python and many shells](https://wakatime.com/terminal)
- [codestats plugins](https://codestats.net/plugins)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "repl-python-wakatime",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "wakatime, plugin, python, ipython, ptpython",
    "author": null,
    "author_email": "Wu Zhenyu <wuzhenyu@ustc.edu>",
    "download_url": "https://files.pythonhosted.org/packages/48/49/e66a6cacc3844c99b3bc46377aca75cee92e95f933c257de32dbc4de8e95/repl_python_wakatime-0.1.6.tar.gz",
    "platform": null,
    "description": "# 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![screen](https://github.com/user-attachments/assets/4e337cae-06a7-4164-be83-c7b73e8a0f63)\n\n## REPLs\n\n### [python](https://github.com/python/cpython)\n\n[`$PYTHON_STARTUP`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP):\n\n```python\nimport sys\n\nfrom repl_python_wakatime.backends.wakatime import Wakatime\nfrom repl_python_wakatime.frontends.python import Python\n\nsys.ps1 = Python(Wakatime())\n```\n\n### [ptpython](https://github.com/prompt-toolkit/ptpython)\n\n`${XDG_CONFIG_HOME:-$HOME/.config}/ptpython/config.py`:\n\n```python\nfrom repl_python_wakatime.backends.wakatime import Wakatime\nfrom repl_python_wakatime.frontends.ptpython import Ptpython\n\n\ndef configure(repl: PythonRepl) -> None:\n    repl.all_prompt_styles[repl.prompt_style] = Ptpython(\n        Wakatime(), repl.all_prompt_styles[repl.prompt_style]\n    )\n```\n\n### [ipython](https://github.com/ipython/ipython)/[ptipython](https://github.com/prompt-toolkit/ptpython)\n\n`~/.ipython/profile_default/ipython_config.py`:\n\n```python\nfrom repl_python_wakatime.backends.wakatime import Wakatime\nfrom repl_python_wakatime.frontends.ipython import Ipython\n\nc.TerminalInteractiveShell.prompts_class = lambda *args, **kwargs: Ipython(\n    Wakatime(),\n    c.TerminalInteractiveShell.prompts_class(*args, **kwargs),\n)\n```\n\n### [gdb](https://sourceware.org/gdb/)\n\nYour `gdb` must be compiled with\n[python port](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Python.html).\n\n`~/.config/gdb/gdbinit`:\n\n```gdb\nsource ~/.config/gdb/gdbinit.py\n```\n\n`~/.config/gdb/gdbinit.py`:\n\n```python\nfrom repl_python_wakatime.backends.wakatime import Wakatime\nfrom repl_python_wakatime.frontends.gdb import StopHook\n\nStopHook(Wakatime())\n```\n\n- [ ] [bpython](https://github.com/bpython/bpython)\n- [ ] [xonsh](https://github.com/xonsh/xonsh)\n- [ ] [mypython](https://github.com/asmeurer/mypython): won't fix due to no any\n  configuration.\n- [ ] vim/neovim with python support: see\n  [vim-wakatime](https://github.com/wakatime/vim-wakatime) and\n  [code-stats.nvim](https://github.com/Freed-Wu/code-stats.nvim)\n\n## Hooks\n\n- [x] [wakatime](https://wakatime.com/)\n- [x] [codestats](https://codestats.net/)\n- [ ] [codetime](https://codetime.dev/)\n- [ ] [rescuetime](https://www.rescuetime.com/)\n\nYou can use many hooks at the same time:\n\n```python\nfrom repl_python_wakatime.backends.chainedhook import ChainedHook\nfrom repl_python_wakatime.backends.codestats import CodeStats\nfrom repl_python_wakatime.backends.wakatime import Wakatime\nfrom repl_python_wakatime.frontends.python import Python\n\nsys.ps1 = Python(ChainedHook(hooks=(Wakatime(), CodeStats())))\n```\n\n## APIs\n\nYou can use this project to statistic the time of using any programs. Such as,\n[translate-shell](https://github.com/Freed-Wu/translate-shell/) is a translating\nprogram:\n\n```python\nfrom repl_python_wakatime.backends.wakatime import Wakatime\nfrom repl_python_wakatime.frontends import Repl\n\nrepl = Repl(Wakatime(language=\"translate-shell\", category=\"translating\"))\n# after each translating\nrepl()\n```\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",
    "bugtrack_url": null,
    "license": "GPL v3",
    "summary": "Python REPL plugin for automatic time tracking and metrics generated from your programming activity",
    "version": "0.1.6",
    "project_urls": {
        "Bug Report": "https://github.com/wakatime/repl-python-wakatime/issues",
        "Download": "https://github.com/wakatime/repl-python-wakatime/releases",
        "Homepage": "https://repl-python-wakatime.readthedocs.io",
        "Source": "https://github.com/wakatime/repl-python-wakatime"
    },
    "split_keywords": [
        "wakatime",
        " plugin",
        " python",
        " ipython",
        " ptpython"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8df338a38645bac9ef4151ae8c7e52f14706810a33e0d1d2117b125f1b7f9e39",
                "md5": "28b9b5cae841d010923c72e6def76d7c",
                "sha256": "81d3ec26a1d19dde61d4c7cf978941b91003a9caa92c9f5f4fe6dd578d6ac81f"
            },
            "downloads": -1,
            "filename": "repl_python_wakatime-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "28b9b5cae841d010923c72e6def76d7c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 23140,
            "upload_time": "2025-10-09T06:34:08",
            "upload_time_iso_8601": "2025-10-09T06:34:08.226780Z",
            "url": "https://files.pythonhosted.org/packages/8d/f3/38a38645bac9ef4151ae8c7e52f14706810a33e0d1d2117b125f1b7f9e39/repl_python_wakatime-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4849e66a6cacc3844c99b3bc46377aca75cee92e95f933c257de32dbc4de8e95",
                "md5": "d31753ce28fa7043e74e2ec74fda3485",
                "sha256": "5fb7cd56434dcd8cd763ed612543b9924cf2e33c5f5854c96936ec7b6482c8b0"
            },
            "downloads": -1,
            "filename": "repl_python_wakatime-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "d31753ce28fa7043e74e2ec74fda3485",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 28446,
            "upload_time": "2025-10-09T06:34:09",
            "upload_time_iso_8601": "2025-10-09T06:34:09.223757Z",
            "url": "https://files.pythonhosted.org/packages/48/49/e66a6cacc3844c99b3bc46377aca75cee92e95f933c257de32dbc4de8e95/repl_python_wakatime-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-09 06:34:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wakatime",
    "github_project": "repl-python-wakatime",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "repl-python-wakatime"
}
        
Elapsed time: 2.07661s