Skip to main content

stack overflow search on exception

Project description

License Version Downloads Supported Versions

CodeBuddy v0.0.3

stack overflow search on exception

Overview

codebuddy is a tool for python programmers. On exceptions, it uses the stack overflow public api to search for top answers and returns them in a neat fashion, along with traceback information for debug information.

Features

  • Blazing-fast and simple error catching
  • Neat and clean possible solution output
  • Intuitive API

Examples

Basic Usage

from codebuddy import codebuddy

def main():
    print(7 + "3") # <= that's illegal

codebuddy(main)

This code returns an error, which codebuddy catches and gets stack overflow answers for.

$ python3 main.py

Traceback (most recent call last):
  File "/home/aarushgupta/fun/codebuddy/codebuddy/__init__.py", line 6, in codebuddy
    function()
  File "test.py", line 4, in bob
    print(7 + "3")
TypeError: unsupported operand type(s) for +: 'int' and 'str'

============================================================================================
Exception of type TypeError caught by CodeBuddy
============================================================================================

============================================================================================
Possible Solutions
============================================================================================

--------------------------------------------------------------------------------------------

Python TypeError: unsupported operand type(s) for +: 'int' and 'str'
    I Have been working on a project and get the following error: `TypeError: unsupported operand type(s) for +: 'int' and 'str'.`
    URL: https://stackoverflow.com/questions/29261566/python-typeerror-unsupported-operand-types-for-int-and-str

--------------------------------------------------------------------------------------------

...

Very neat indeed! The user also gets the description and url to the question in the results as well.

Advanced Usage

codebuddy also supports arguments

from codebuddy import codebuddy

def main(number: int):
    print(number + "3") # <= that's still illegal

codebuddy(main, 1) # executes function as "main(1)"

Copyright © 2022 Aarush Gupta

This code is copyrighted but licensed to the public under the GNU AGPLv3 license and any later versions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codebuddy-0.0.3.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file codebuddy-0.0.3.tar.gz.

File metadata

  • Download URL: codebuddy-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for codebuddy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 94fe4466797071b02c8247e503fdca7d9f5c3a82c3a439d0f24335b8eb2461d7
MD5 c2da9486b4ad944f42c6e1a6279e8d9c
BLAKE2b-256 6abc886a2fc2d8524530df2b69244c8ae9511ec5a66d67ad4d20704cbbf43c41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page