Skip to main content

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

Project description

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

$PYTHON_STARTUP:

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repl_python_wakatime-0.1.6.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repl_python_wakatime-0.1.6-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

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

Hashes for repl_python_wakatime-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5fb7cd56434dcd8cd763ed612543b9924cf2e33c5f5854c96936ec7b6482c8b0
MD5 d31753ce28fa7043e74e2ec74fda3485
BLAKE2b-256 4849e66a6cacc3844c99b3bc46377aca75cee92e95f933c257de32dbc4de8e95

See more details on using hashes here.

File details

Details for the file repl_python_wakatime-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for repl_python_wakatime-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 81d3ec26a1d19dde61d4c7cf978941b91003a9caa92c9f5f4fe6dd578d6ac81f
MD5 28b9b5cae841d010923c72e6def76d7c
BLAKE2b-256 8df338a38645bac9ef4151ae8c7e52f14706810a33e0d1d2117b125f1b7f9e39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page