repl-python-codestats

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

A codestats plugin for python REPLs.

Supported REPLs:

from repl_python_codestats.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_codestats.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_codestats.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

install_hook(kwargs={"api_key": "your API key for codestats"})

Or see keyring.

Similar projects