Enhanced error messages from Stackoverflow
Project description
Pycee
Pycee is a tool to provide possible solutions for errors in python code. Solutions are from Stackoverflow questions that may be related to the code error. This is a reimplementation of Emillie Thiselton's Pycee.
:gear: Installation
pip3 install pycee
:computer: Using Pycee2
After installed, all you have to do is to call pycee
passing the name of the file that contains the error.
pycee file_with_error.py
Here's an example:
Suppose script.py
contains the following code:
# Brazil world cup titles by year
world_cup_titles = [1958,1962,1970,1994,2002]
# print year of the 5th title
print(world_cup_titles[5])
executing this script will result in an error like this:
Traceback (most recent call last):
File "example_code.py", line 4, in <module>
print(world_cup_titles[5])
IndexError: list index out of range
Then you can use pycee to provide an possible answer for the error, linke so:
pycee script.py
Which, finally, will output some answers form stackoverflow that are possibily related to your error:
Solution 1:
Generally it means that you are providing an index for which a list element
does not exist.
E.g, if your list was [1, 3, 5, 7], and you asked for the element at index
10, you would be well out of bounds and receive an error, as only elements 0
through 3 exist.
...
(rest of the output with two more answers omitted from this example)
:gear: Installation (for contributors)
# clone the repository your development environment
git clone https://github.com/marceloFA/pycee2.git
# cd into the project directory
cd pycee2/
# create a virtual environment to install packages isolatedly
python3 -m venv venv # if you use venv
virtualenv venv # else if you use virtualenv
# activate the virtual env
source venv/bin/activate
# install packages required to run pycee
pip3 install -r requirements.txt requirements-dev.txt
# using pycee in development mode, from the project root
python3 usage.py example_code.py
# running tests, from the project root
pytest
:building_construction: Maintainers
Leonardo Furtado | Marcelo Almeida |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pycee2-0.1.tar.gz
.
File metadata
- Download URL: pycee2-0.1.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ce45bad6bf55d5592d4f20113d277f6c9e430257f35ad15f95c1943c5f3bb99 |
|
MD5 | bc24851f80b7a00a26798b0b1e519b38 |
|
BLAKE2b-256 | 21b9b5bff8e1d9c3d332aea8b87bdde31d22a6e95e4e2723ca161355e64fab36 |
File details
Details for the file pycee2-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: pycee2-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d03127801dad5373666e5f75e4423ed96d77b55afad2ac02b9ca4708f01e5f |
|
MD5 | 33dbd5798b91423e1d812a6b1e9dd626 |
|
BLAKE2b-256 | a4b3ab1abb8f3b10ce869dc847dd7b977f1565a864f5926accfb1bd4c15c38e1 |