# ytho
Change Python's prompt with ease. Because `>>>` is boring.
## Installation
```bash
pip install ytho
```
## Usage
Define a file `.ytho.py` in your home directory, with a class `Prompt`.
This will define your prompt. For example:
```python
class Prompt:
def __init__(self):
self.counter = 0
def prompt(self) -> tuple[str, str]:
self.counter += 1
ps1 = f"\033[1;32mIn [{self.counter}] \033[m: "
# The ANSI codes take up 10 chars, remove those
ps2 = " " * (len(ps1) - 10)
return ps1, ps2
```
And now you have IPython's prompt. And you can do a lot more than that if you want!.
## Local Development / Testing
- Create and activate a virtual environment
- Run `pip install -r requirements-dev.txt` to do an editable install
- Run `pytest` to run tests
## Type Checking
Run `mypy .`
## Create and upload a package to PyPI
Make sure to bump the version in `setup.cfg`.
Then run the following commands:
```bash
rm -rf build dist
python setup.py sdist bdist_wheel
```
Then upload it to PyPI using [twine](https://twine.readthedocs.io/en/latest/#installation):
```bash
twine upload dist/*
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tusharsadhwani/ytho",
"name": "ytho",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Tushar Sadhwani",
"author_email": "tushar.sadhwani000@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/67/3c/67f19e60e6118cc75d92cc50da4341478a125e9a829100e06bc98e2075f1/ytho-0.1.0.tar.gz",
"platform": null,
"description": "# ytho\n\nChange Python's prompt with ease. Because `>>>` is boring.\n\n## Installation\n\n```bash\npip install ytho\n```\n\n## Usage\n\nDefine a file `.ytho.py` in your home directory, with a class `Prompt`.\n\nThis will define your prompt. For example:\n\n```python\nclass Prompt:\n def __init__(self):\n self.counter = 0\n\n def prompt(self) -> tuple[str, str]:\n self.counter += 1\n ps1 = f\"\\033[1;32mIn [{self.counter}] \\033[m: \"\n # The ANSI codes take up 10 chars, remove those\n ps2 = \" \" * (len(ps1) - 10)\n return ps1, ps2\n```\n\nAnd now you have IPython's prompt. And you can do a lot more than that if you want!.\n\n## Local Development / Testing\n\n- Create and activate a virtual environment\n- Run `pip install -r requirements-dev.txt` to do an editable install\n- Run `pytest` to run tests\n\n## Type Checking\n\nRun `mypy .`\n\n## Create and upload a package to PyPI\n\nMake sure to bump the version in `setup.cfg`.\n\nThen run the following commands:\n\n```bash\nrm -rf build dist\npython setup.py sdist bdist_wheel\n```\n\nThen upload it to PyPI using [twine](https://twine.readthedocs.io/en/latest/#installation):\n\n```bash\ntwine upload dist/*\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Change your REPL prompt.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/tusharsadhwani/ytho"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "90e6f5b9b65a408807f956a341342a41cb94b6d6eeb2efce605c97725e4b9489",
"md5": "25c134e42a9623b5910210ca0cb7d1bd",
"sha256": "668f8cd3dcd00b455f317d734c60c79eee93ce074787c01dca64ec1e8a95a587"
},
"downloads": -1,
"filename": "ytho-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "25c134e42a9623b5910210ca0cb7d1bd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4560,
"upload_time": "2023-12-16T10:16:10",
"upload_time_iso_8601": "2023-12-16T10:16:10.955208Z",
"url": "https://files.pythonhosted.org/packages/90/e6/f5b9b65a408807f956a341342a41cb94b6d6eeb2efce605c97725e4b9489/ytho-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "673c67f19e60e6118cc75d92cc50da4341478a125e9a829100e06bc98e2075f1",
"md5": "e540d62efe667107f485e022db27f2d2",
"sha256": "476f0c716643c6189ba72c648bf93a83eba223c7cbe85dc01288cd59e34ac25f"
},
"downloads": -1,
"filename": "ytho-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "e540d62efe667107f485e022db27f2d2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4717,
"upload_time": "2023-12-16T10:16:13",
"upload_time_iso_8601": "2023-12-16T10:16:13.176226Z",
"url": "https://files.pythonhosted.org/packages/67/3c/67f19e60e6118cc75d92cc50da4341478a125e9a829100e06bc98e2075f1/ytho-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-16 10:16:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tusharsadhwani",
"github_project": "ytho",
"github_not_found": true,
"lcname": "ytho"
}