Python REPL plugin for automatic time tracking and metrics generated from your programming activity
Project description
repl-python-wakatime
Python REPL plugin for automatic time tracking and metrics generated from your programming activity.
REPLs
python
import sys
from repl_python_wakatime.backends.wakatime import Wakatime
from repl_python_wakatime.frontends.python import Python
sys.ps1 = Python(Wakatime())
ptpython
${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/ptipython
~/.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),
)
gdb
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repl_python_wakatime-0.1.6.tar.gz.
File metadata
- Download URL: repl_python_wakatime-0.1.6.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fb7cd56434dcd8cd763ed612543b9924cf2e33c5f5854c96936ec7b6482c8b0
|
|
| MD5 |
d31753ce28fa7043e74e2ec74fda3485
|
|
| BLAKE2b-256 |
4849e66a6cacc3844c99b3bc46377aca75cee92e95f933c257de32dbc4de8e95
|
File details
Details for the file repl_python_wakatime-0.1.6-py3-none-any.whl.
File metadata
- Download URL: repl_python_wakatime-0.1.6-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81d3ec26a1d19dde61d4c7cf978941b91003a9caa92c9f5f4fe6dd578d6ac81f
|
|
| MD5 |
28b9b5cae841d010923c72e6def76d7c
|
|
| BLAKE2b-256 |
8df338a38645bac9ef4151ae8c7e52f14706810a33e0d1d2117b125f1b7f9e39
|