Skip to main content
File added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

What The Python?!

Helping you find answers to the errors Python spits out.

Installation

You can find the source code on GitHub at: https://github.com/what-the-python/wtpython

To install directly please run:

pip install wtpython

Usage

When you are running a python script, you might eventually come across an error like so.

$ python example/runs_with_error.py
0
1
2
Traceback (most recent call last):
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/example/runs_with_error.py", line 8, in <module>
    requests.get('badurl')
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/models.py", line 390, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'badurl': No schema supplied. Perhaps you meant http://badurl?

In this case, simply replace python with wtpython and you will see the error message line as well as what installed packages were part of the stack trace.

$ wtpython example/runs_with_error.py

This will bring up something like below, the color scheme might be different based off how your terminal is setup.

wtpython TUI

Development Tools

  • Rich is a library to create styled text to the terminal. We'll use it for styling and formatting text.
  • Textual is a part of rich to further aid in TUI design. We'll use it to create widgets and adjust the change the layout of the TUI.
  • Flit is a simple way to develop Python packages. It's pretty lightweight but can do a lot. We'll use it to manage dependencies.
  • pre-commit will run a few tests before you can commit your code. Don't worry, it will make the changes for you. Worst case, you'll have to type the git add/commit lines twice.

Contribution instructions

To setup the system for development please fork the repository and do the below before submitting a pull request.

Create and activate a virtual environment

python -m venv .venv --prompt template
source .venv/bin/activate

Upgrade pip and install flit manually

python -m pip install -U pip flit

Run this command to install the package in your virtual environment. If you add dependencies to pyproject.toml, you'll have to run this command again to install the new dependencies. Make sure to pin the version in pyproject.toml.

flit install -s

Install pre-commit

The .pre-commit-config.yaml file is configured to perform the following tasks on each commit:

  • Validate yaml files
  • Validate toml files
  • Ensure a single new line on each file
  • Ensure trailing white spaces are removed
  • Format your code with black
  • Ensure your python imports are sorted consistently
pre-commit install

FAQ

  1. How do I clear all of the cached results?

You can clear the cache by using the --clear-cache param for the query or run delete the ~/.wtpython_cache.

Metadata

Release files for wtpython 0.1

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

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for wtpython 0.1
File Size Uploaded
wtpython-0.1.tar.gz 23.6 MB Details

Built distributions (wheels)

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

Total release size: 23.6 MB

Release files / wtpython-0.1.tar.gz

Download URL wtpython-0.1.tar.gz
Size 23.6 MB
Tags Source
SHA-256 checksum
How to use checksums
43f0129c2db18d7c3cd44cee8df464052041adfae7b70b158d173356d665ab1b
BLAKE2b-256 checksum
How to use checksums
a3b6863d3d35ee28c618e921bebd96bfa1016c90bb7d970e9169d60188f5a9d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

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

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL wtpython-0.1.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d42c42ff23cb0a3eb99373aedf38e1cf6716a6ca6bc328aae7472e6a7e00dac
BLAKE2b-256 checksum
How to use checksums
fbfbf813f0d8befe0f2495f7a67b18748b0040c8591c6bc0fc1272102e32857a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.8 CPython/3.9.6 Darwin/20.6.0

Release files / wtpython-0.1-py3-none-any.whl

Download URL wtpython-0.1-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c81ea7e6abf8bb61badf5b3dac4ffaffeb50fa69aeb20b4000b3916c0f3fde6e
BLAKE2b-256 checksum
How to use checksums
b700aba68cc8eef9d8f4428cef5a5ed2b8829c4f2abe8bbecd4d5d6bfe4f56a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release history Release notifications | RSS feed

This release

0.1 This release

3 release files

0.0.1

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