Skip to main content

License Version Downloads Supported Versions

CodeBuddy v0.0.2

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.

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.

Metadata

Release files for codebuddy 0.0.4

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

Source distribution (sdist)

Source distribution for codebuddy 0.0.4
File Size Uploaded
codebuddy-0.0.4.tar.gz 15.2 kB Details

Built distribution (wheel)

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

Total release size: 31.0 kB

Release files / codebuddy-0.0.4.tar.gz

Download URL codebuddy-0.0.4.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
82e53cca08afe458e7eaa19ea81daba8114ea9b108f80a5c44c82f956c8f7fcf
BLAKE2b-256 checksum
How to use checksums
0b5d2d43ec227749339216e7e93f1e0c8dbecb445bdefd2ea7b9daedca2cd608
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / codebuddy-0.0.4-py3-none-any.whl

Download URL codebuddy-0.0.4-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a50ba008a73abc0461a343153e43e264afd1d3099d010c3b851e154433afaa74
BLAKE2b-256 checksum
How to use checksums
9471eb5eedb088f0aeaf63477bbdde3442fba74c9210dbdebf923b467578026b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

1 release file

0.0.2

2 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