# repl-python-codestats
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/repl-python-codestats/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/repl-python-codestats/main)
[![github/workflow](https://github.com/Freed-Wu/repl-python-codestats/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/repl-python-codestats/actions)
[![codecov](https://codecov.io/gh/Freed-Wu/repl-python-codestats/branch/main/graph/badge.svg)](https://codecov.io/gh/Freed-Wu/repl-python-codestats)
[![readthedocs](https://shields.io/readthedocs/repl-python-codestats)](https://repl-python-codestats.readthedocs.io)
[![github/downloads](https://shields.io/github/downloads/Freed-Wu/repl-python-codestats/total)](https://github.com/Freed-Wu/repl-python-codestats/releases)
[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/repl-python-codestats/latest/total)](https://github.com/Freed-Wu/repl-python-codestats/releases/latest)
[![github/issues](https://shields.io/github/issues/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/issues)
[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/issues?q=is%3Aissue+is%3Aclosed)
[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/pulls)
[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/pulls?q=is%3Apr+is%3Aclosed)
[![github/discussions](https://shields.io/github/discussions/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/discussions)
[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/milestones)
[![github/forks](https://shields.io/github/forks/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/network/members)
[![github/stars](https://shields.io/github/stars/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/stargazers)
[![github/watchers](https://shields.io/github/watchers/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/watchers)
[![github/contributors](https://shields.io/github/contributors/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/graphs/contributors)
[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/graphs/commit-activity)
[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/commits)
[![github/release-date](https://shields.io/github/release-date/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/releases/latest)
[![github/license](https://shields.io/github/license/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/blob/main/LICENSE)
[![github/languages](https://shields.io/github/languages/count/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)
[![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)
[![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)
[![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)
[![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)
[![github/v](https://shields.io/github/v/release/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)
[![pypi/status](https://shields.io/pypi/status/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#description)
[![pypi/v](https://shields.io/pypi/v/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#history)
[![pypi/downloads](https://shields.io/pypi/dd/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)
[![pypi/format](https://shields.io/pypi/format/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)
[![pypi/implementation](https://shields.io/pypi/implementation/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)
[![pypi/pyversions](https://shields.io/pypi/pyversions/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)
A [codestats](https://codestats.net) plugin for python REPLs.
Supported REPLs:
- [x] [python](https://github.com/python/cpython):
- executes
[`str(sys.ps1)`](https://docs.python.org/3/library/sys.html#sys.ps1) after
every input.
- configure file:
[`$PYTHON_STARTUP`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP).
```python
from repl_python_codestats.python import install_hook
install_hook()
```
- [x] [ptpython](https://github.com/prompt-toolkit/ptpython):
- executes `get_ptpython().get_output_prompt()` after every output.
- configure file: `.../ptpython/config.py`. `...` depends on OS.
```python
from ptpython.repl import PythonRepl
from repl_python_codestats.ptpython import install_hook
def configure(repl: PythonRepl) -> None:
install_hook(repl)
```
- [x] [ipython](https://github.com/ipython/ipython):
- executes
`c.TerminalInteractiveShell.prompts_class(shell).out_prompt_tokens()` after
every output.
- configure file: `~/.ipython/profile_default/ipython_config.py`.
```python
from repl_python_codestats.iptpython import install_hook
install_hook(c)
```
- [x] [ptipython](https://github.com/prompt-toolkit/ptpython): Same as
[ipython](https://github.com/ipython/ipython).
- [ ] [bpython](https://github.com/bpython/bpython)
- [ ] [xonsh](https://github.com/xonsh/xonsh)
- [ ] [mypython](https://github.com/asmeurer/mypython): Won't fix.
- configure file: non-exist.
`install_hook()` must be after the customization of the prompt string and best
at the end of file.
## Configure
```python
install_hook(kwargs={"api_key": "your API key for codestats"})
```
Or see [keyring](docs/resources/requirements.md#keyring).
## Similar projects
- [wakatime plugins for python and many shells](https://wakatime.com/terminal)
- [codestats plugins](https://codestats.net/plugins)
Raw data
{
"_id": null,
"home_page": "",
"name": "repl-python-codestats",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "codestats,plugin,python,ptpython,ipython",
"author": "",
"author_email": "Wu Zhenyu <wuzhenyu@ustc.edu>",
"download_url": "https://files.pythonhosted.org/packages/6d/26/d9ac5fb32adc77982a0b3de9fae122eb274736664d5a35906001d24c0267/repl-python-codestats-0.0.6.tar.gz",
"platform": null,
"description": "# repl-python-codestats\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/repl-python-codestats/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/repl-python-codestats/main)\n[![github/workflow](https://github.com/Freed-Wu/repl-python-codestats/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/repl-python-codestats/actions)\n[![codecov](https://codecov.io/gh/Freed-Wu/repl-python-codestats/branch/main/graph/badge.svg)](https://codecov.io/gh/Freed-Wu/repl-python-codestats)\n[![readthedocs](https://shields.io/readthedocs/repl-python-codestats)](https://repl-python-codestats.readthedocs.io)\n\n[![github/downloads](https://shields.io/github/downloads/Freed-Wu/repl-python-codestats/total)](https://github.com/Freed-Wu/repl-python-codestats/releases)\n[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/repl-python-codestats/latest/total)](https://github.com/Freed-Wu/repl-python-codestats/releases/latest)\n[![github/issues](https://shields.io/github/issues/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/issues)\n[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/issues?q=is%3Aissue+is%3Aclosed)\n[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/pulls)\n[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/pulls?q=is%3Apr+is%3Aclosed)\n[![github/discussions](https://shields.io/github/discussions/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/discussions)\n[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/milestones)\n[![github/forks](https://shields.io/github/forks/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/network/members)\n[![github/stars](https://shields.io/github/stars/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/stargazers)\n[![github/watchers](https://shields.io/github/watchers/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/watchers)\n[![github/contributors](https://shields.io/github/contributors/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/graphs/contributors)\n[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/graphs/commit-activity)\n[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/commits)\n[![github/release-date](https://shields.io/github/release-date/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/releases/latest)\n\n[![github/license](https://shields.io/github/license/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats/blob/main/LICENSE)\n[![github/languages](https://shields.io/github/languages/count/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)\n[![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)\n[![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)\n[![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)\n[![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)\n[![github/v](https://shields.io/github/v/release/Freed-Wu/repl-python-codestats)](https://github.com/Freed-Wu/repl-python-codestats)\n\n[![pypi/status](https://shields.io/pypi/status/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#description)\n[![pypi/v](https://shields.io/pypi/v/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#history)\n[![pypi/downloads](https://shields.io/pypi/dd/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)\n[![pypi/format](https://shields.io/pypi/format/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)\n[![pypi/implementation](https://shields.io/pypi/implementation/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)\n[![pypi/pyversions](https://shields.io/pypi/pyversions/repl-python-codestats)](https://pypi.org/project/repl-python-codestats/#files)\n\nA [codestats](https://codestats.net) plugin for python REPLs.\n\nSupported REPLs:\n\n- [x] [python](https://github.com/python/cpython):\n - executes\n [`str(sys.ps1)`](https://docs.python.org/3/library/sys.html#sys.ps1) after\n every input.\n - configure file:\n [`$PYTHON_STARTUP`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP).\n\n```python\nfrom repl_python_codestats.python import install_hook\n\ninstall_hook()\n```\n\n- [x] [ptpython](https://github.com/prompt-toolkit/ptpython):\n - executes `get_ptpython().get_output_prompt()` after every output.\n - configure file: `.../ptpython/config.py`. `...` depends on OS.\n\n```python\nfrom ptpython.repl import PythonRepl\nfrom repl_python_codestats.ptpython import install_hook\n\n\ndef configure(repl: PythonRepl) -> None:\n install_hook(repl)\n```\n\n- [x] [ipython](https://github.com/ipython/ipython):\n - executes\n `c.TerminalInteractiveShell.prompts_class(shell).out_prompt_tokens()` after\n every output.\n - configure file: `~/.ipython/profile_default/ipython_config.py`.\n\n```python\nfrom repl_python_codestats.iptpython import install_hook\n\ninstall_hook(c)\n```\n\n- [x] [ptipython](https://github.com/prompt-toolkit/ptpython): Same as\n [ipython](https://github.com/ipython/ipython).\n- [ ] [bpython](https://github.com/bpython/bpython)\n- [ ] [xonsh](https://github.com/xonsh/xonsh)\n- [ ] [mypython](https://github.com/asmeurer/mypython): Won't fix.\n - configure file: non-exist.\n\n`install_hook()` must be after the customization of the prompt string and best\nat the end of file.\n\n## Configure\n\n```python\ninstall_hook(kwargs={\"api_key\": \"your API key for codestats\"})\n```\n\nOr see [keyring](docs/resources/requirements.md#keyring).\n\n## Similar projects\n\n- [wakatime plugins for python and many shells](https://wakatime.com/terminal)\n- [codestats plugins](https://codestats.net/plugins)\n",
"bugtrack_url": null,
"license": "GPL v3",
"summary": "A codestats plugin for python REPLs",
"version": "0.0.6",
"split_keywords": [
"codestats",
"plugin",
"python",
"ptpython",
"ipython"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f964b37686583b909b67c0a513bc63008f3143e09721af5fbd2966851e2ce710",
"md5": "acf5b40feac3e521b40c5163981aeb52",
"sha256": "838fe8d7fdcbce57c091448432592f135187a166d09107cf8a9b13741ac429a0"
},
"downloads": -1,
"filename": "repl_python_codestats-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "acf5b40feac3e521b40c5163981aeb52",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 19864,
"upload_time": "2023-04-11T18:50:02",
"upload_time_iso_8601": "2023-04-11T18:50:02.536041Z",
"url": "https://files.pythonhosted.org/packages/f9/64/b37686583b909b67c0a513bc63008f3143e09721af5fbd2966851e2ce710/repl_python_codestats-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6d26d9ac5fb32adc77982a0b3de9fae122eb274736664d5a35906001d24c0267",
"md5": "85542f2ceb48a3ce5da0924379041bca",
"sha256": "5aa53ae789f684bbda8c6293451e38ec70ef2e1b7996aa256230eab6a1b1d771"
},
"downloads": -1,
"filename": "repl-python-codestats-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "85542f2ceb48a3ce5da0924379041bca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 26839,
"upload_time": "2023-04-11T18:51:03",
"upload_time_iso_8601": "2023-04-11T18:51:03.344289Z",
"url": "https://files.pythonhosted.org/packages/6d/26/d9ac5fb32adc77982a0b3de9fae122eb274736664d5a35906001d24c0267/repl-python-codestats-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-11 18:51:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "repl-python-codestats"
}