repl-python-wakatime¶
Python REPL plugin for automatic time tracking and metrics generated from your programming activity.
Supported REPLs:
[x] python:
executes
str(sys.ps1)
after every input.configure file:
$PYTHON_STARTUP
.
from repl_python_wakatime.python import install_hook
install_hook()
[x] ptpython:
executes
get_ptpython().get_output_prompt()
after every output.configure file:
.../ptpython/config.py
....
depends on OS.
from ptpython.repl import PythonRepl
from repl_python_wakatime.ptpython import install_hook
def configure(repl: PythonRepl) -> None:
install_hook(repl)
[x] ipython:
executes
c.TerminalInteractiveShell.prompts_class(shell).out_prompt_tokens()
after every output.configure file:
~/.ipython/profile_default/ipython_config.py
.
from repl_python_wakatime.iptpython import install_hook
install_hook(c)
install_hook()
must be after the customization of the prompt string and best
at the end of file.
Configure¶
from repl_python_wakatime.python import install_hook
install_hook(hook_function, args, kwargs)
will execute hook_function(*args, **kwargs)
after every output/input. Other
REPLs are similar. Currently, hook_function
can be:
repl_python_wakatime.hooks.wakatime.wakatime_hook()
: By default.repl_python_wakatime.hooks.codestats.codestats_hook()
: for codestatsCreate your hooks for other similar projects, such as: