Python REPL plugin for automatic time tracking and metrics generated from your programming activity.
import sys
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.python import Python
sys.ps1 = Python(Wakatime())
${XDG_CONFIG_HOME:-$HOME/.config}/ptpython/config.py
:
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/profile_default/ipython_config.py
:
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),
)
Your gdb
must be compiled with
python port.
~/.config/gdb/gdbinit
:
source ~/.config/gdb/gdbinit.py
~/.config/gdb/gdbinit.py
:
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.gdb import StopHook
StopHook(Wakatime())
- bpython
- xonsh
- mypython: won't fix due to no any configuration.
- vim/neovim with python support: see vim-wakatime and code-stats.nvim
You can use many hooks at the same time:
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(Wakatime() | CodeStats())
You can use this project to statistic the time of using any programs. Such as, translate-shell is a translating program:
from repl_python_wakatime.backends.wakatime import Wakatime
# after each translating
Wakatime(language="translate-shell", category="translating")()