Skip to content

wakatime/repl-python-wakatime

Repository files navigation

repl-python-wakatime

pre-commit.ci status github/workflow codecov readthedocs

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

pypi/status pypi/v pypi/downloads pypi/format pypi/implementation pypi/pyversions

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

screen

REPLs

$PYTHON_STARTUP:

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())

Hooks

You can use many hooks at the same time:

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 is a translating program:

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages