Skip to main content

Your AI coding mate, Co-Coder.

PyPI package commit update Code style: black

Co-Coder is a Python package that streamlines error debugging from Open AI chat GPT and Google Bard by providing hints, example code, and relevant Stack Overflow links, all by simply importing it and setting the environment variable.

The Python package Co-Coder shows information about errors from Open AI chat GPT and Google Bard. Right below the tracebacked error, you will receive information about the error, debugging hints, and example code. Also, you can use it by modifying the prompt appropriately. Co-Coder helps you automatically get information about errors without Googling or Searching StackOverflow. If you use OpenAI's chatGPT model, it also returns links to Stack Overflow related to the error. The Co-Coder package is executed by simply importing Co-Coder at Python or IPython. Just setting the proper environment variable once.


Install

The latest stable release (and required dependencies) can be installed from PyPI:

pip install cocoder

You may instead want to use the development version from Github:

pip install git+https://github.com/dsdanielpark/Co-Coder.git

Tutorial

Tutorials for all features can be found in this folder. Examples have been prepared for all possible cases.


Authentication

Open AI

Visit Open AI API for more information.

Google Bard

See the Python package BardAPI for more information.

  • Visit https://bard.google.com/
  • F12 for console
  • Session: Application → Cookies → Copy the value of __Secure-1PSID cookie.

Ipython

With Open AI chat GPT

  • Supported Language: English

    English
    Open In Colab

    import cocoder.ipython
    import os
    os.environ['_OPEN_AI_API'] = 'sk-xxxxxxxxxxx'
    os.environ['_OPEN_AI_MODEL'] = "gpt-3.5-turbo" 
    # os.environ['_PROMPT_COMMAND'] = "You can make customized prompt in here."
    
    print(1/0)
    

With Google Bard

  • Supported Language: Korean, English, Japanese

    English
    Open In Colab

    import cocoder.ipython
    import os
    os.environ['_BARD_API_KEY'] = 'xxxxxxxxxxx'
    # os.environ['_PROMPT_COMMAND'] = "You can make customized prompt in here."
    
    print(1/0)
    

    Korean
    Open In Colab

    import cocoder.ipython
    import os
    os.environ['_BARD_API_KEY'] = 'xxxxxxxxxxx'
    os.environ["_BARD_ADVICE_LANG"]='ko'
    # os.environ['_PROMPT_COMMAND'] = "You can make customized prompt in here."
    
    print(1/0)
    

    Japanese
    Open In Colab

    import cocoder.ipython
    import os
    os.environ['_BARD_API_KEY'] = 'xxxxxxxxxxx'
    os.environ["_BARD_ADVICE_LANG"]='jp'
    # os.environ['_PROMPT_COMMAND'] = "You can make customized prompt in here."
    
    print(1/0)
    

Python

With Open AI chat GPT

  • Supported Language: English
    Open In Colab

    from cocoder import ExceptPyCocoder
    import os, sys
    os.environ['_OPEN_AI_API'] = 'sk-xxxxxxxxxxx'
    os.environ['_OPEN_AI_MODEL'] = "gpt-3.5-turbo" 
    # os.environ['_PROMPT_COMMAND'] = "You can make customized prompt in here."
    
    sys.excepthook = ExceptPyCocoder.__call__
    print(1/0)
    

With Google Bard

  • Supported Language: Korean, English, Japanese

    English
    Open In Colab

    from cocoder import ExceptPyCocoder
    import os, sys
    os.environ['_BARD_API_KEY'] = 'xxxxxxx'
    # os.environ["_BARD_ADVICE_LANG"]='ko','jp'
    # os.environ['_PROMPT_COMMAND']="You can make customized prompt in here."
    
    sys.excepthook = ExceptPyCocoder.__call__
    print(1/0)
    

Scripts

In the BardAPI scripts folder, I have released a script to help you compare OpenAI-ChatGPT and Google-Bard. I hope they will help more developers.

License

  • CoCoder: MIT

Licenses apply the each dependencies package, and the created posts follow CC BY-NC-SA.

Bugs and Issues

Sincerely grateful for any reports on new features or bugs. Your valuable feedback on the code is highly appreciated.

Contacts

Reference

[1] https://github.com/dsdanielpark/BARD_API
[2] https://github.com/dsdanielpark/ExceptNotifier

Development Status :: 3 - Alpha
Copyright (c) MinWoo Park 2023

Metadata

Release files for cocoder 0.1.5

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

Source distribution (sdist)

Source distribution for cocoder 0.1.5
File Size Uploaded Provenance Actions
cocoder-0.1.5.tar.gz 10.6 kB Without provenance Details for cocoder-0.1.5.tar.gz

Built distribution (wheel)

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

Total release size: 21.0 kB

Release files / cocoder-0.1.5.tar.gz

Download URL cocoder-0.1.5.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e6641be1f1929eec4763fe7c9e2e27c79f3c3359e273770ac32891e2167b6a02
BLAKE2b-256 checksum
How to use checksums
537375727064e7aa74e73138430da6a576f40bd6233c636574230cdcead798a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / cocoder-0.1.5-py3-none-any.whl

Download URL cocoder-0.1.5-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0d8895edc19aa7fbe97330d0ede11d2d60131fef982b92eb27cafeb0a952042
BLAKE2b-256 checksum
How to use checksums
23d0ef5ad06303368b16a289e0cce5ac200ea905b8bfe5e39aa017ccef6826cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Security for cocoder 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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