Skip to main content

ytho

Change Python's prompt with ease. Because >>> is boring.

Installation

pip install ytho

Usage

Define a file .ytho.py in your home directory, with a class Prompt.

This will define your prompt. For example:

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:

rm -rf build dist
python setup.py sdist bdist_wheel

Then upload it to PyPI using twine:

twine upload dist/*

Metadata

Release files for ytho 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ytho 0.1.0
File Size Uploaded
ytho-0.1.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ytho 0.1.0
File Interpreter ABI Platform
ytho-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / ytho-0.1.0.tar.gz

Download URL ytho-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
476f0c716643c6189ba72c648bf93a83eba223c7cbe85dc01288cd59e34ac25f
BLAKE2b-256 checksum
How to use checksums
673c67f19e60e6118cc75d92cc50da4341478a125e9a829100e06bc98e2075f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / ytho-0.1.0-py3-none-any.whl

Download URL ytho-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
668f8cd3dcd00b455f317d734c60c79eee93ce074787c01dca64ec1e8a95a587
BLAKE2b-256 checksum
How to use checksums
90e6f5b9b65a408807f956a341342a41cb94b6d6eeb2efce605c97725e4b9489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page