Skip to main content

Jupyter Pilot is a Python package that uses the OpenAI API to generate code from natural language prompts. It is designed to simplify the process of writing code and to make programming more accessible to non-programmers.

Project description

JupyterPilot

Jupyter Pilot is a Python package that uses the OpenAI API to generate code from natural language prompts. It is designed to simplify the process of writing code and to make programming more accessible to non-programmers.

Installation

To install Jupyter Pilot, simply run:

pip install jupyterpilot

Update 1.0.0

Please run: pip install --upgrade jupyterpilot

  • Removed issues where people were getting In[ ]: in code.
  • Code insertion in new cell
  • All parameters of model can be set using CodetoCell()
  • Improved accuracy with new default params
  • Note: Most of these errors are model generated. For this exact reason, the code creates a test.py in the same working directory as that of the notebook. User can read and manually or programmatically remove these errors.

    Usage

    To use JupyterPilot, import the pysetup class from the jupyterpilot module:

    from jupyterpilot import pysetup

    Then, create an instance of CodetoCell with your OpenAI API key:

    openai_key = "YOUR_API_KEY"
    cc = pysetup.CodetoCell(openai_key)

    Call the get_code method with a natural language prompt to generate code:

    prompt = "Create a function to get stock data from yahoo finance api"
    cc.get_code(prompt)

    This will create a file called test1.py with the generated code and import statements, and then load the code into a Jupyter Notebook cell for further use.

    Options

    You can pass options to the CodetoCell constructor to customize its behavior:

    cc = pysetup.CodetoCell(
        	openai_key=openai_key,
        	model="code-cushman-001", # Choose a different model (optional)
        	tokens=2048, # Increase the number of tokens (optional)
    	tokens=1024 # (optional), 
    	temperature=0.1 # (optional),
    	top_p=1 # (optional),
    	penalty=0, # (optional)
    	presence_penalty=0 # (optional)
    )

    You can choose a different model by setting the model parameter to a different model ID. Other models can be found on the OpenAI API documentation.

    You can increase the number of tokens by setting the tokens parameter to a larger value. The maximum number of tokens supported by the code-cushman-001 model is 2048, while the code-davinci-002 model supports up to 8000 tokens.

    Authors

    @ishu121992

    License

    JupyterPilot is licensed under the MIT License. See the LICENSE file for details.

    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

    jupyterpilot-1.0.0.tar.gz (5.2 kB view details)

    Uploaded Source

    Built Distribution

    If you're not sure about the file name format, learn more about wheel file names.

    jupyterpilot-1.0.0-py3-none-any.whl (5.3 kB view details)

    Uploaded Python 3

    File details

    Details for the file jupyterpilot-1.0.0.tar.gz.

    File metadata

    • Download URL: jupyterpilot-1.0.0.tar.gz
    • Upload date:
    • Size: 5.2 kB
    • Tags: Source
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/4.0.2 CPython/3.10.9

    File hashes

    Hashes for jupyterpilot-1.0.0.tar.gz
    Algorithm Hash digest
    SHA256 fc6a13b6e066c0b132b1493bc88680b484eec86f9ed1a1a18e5da31b2cd14a12
    MD5 e3e8a3ac60869092fa9d3332fec6b1cd
    BLAKE2b-256 a1f87141ecd47dbe424993d1d6e3be05a881a833caf5ac75ff9d22f328b9412e

    See more details on using hashes here.

    File details

    Details for the file jupyterpilot-1.0.0-py3-none-any.whl.

    File metadata

    • Download URL: jupyterpilot-1.0.0-py3-none-any.whl
    • Upload date:
    • Size: 5.3 kB
    • Tags: Python 3
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/4.0.2 CPython/3.10.9

    File hashes

    Hashes for jupyterpilot-1.0.0-py3-none-any.whl
    Algorithm Hash digest
    SHA256 ec6b509541480ca522a48e3af3df676e86cacd7199c149c14cad93a33174f2e8
    MD5 259beb2477349cfe3b95bed90f11d46b
    BLAKE2b-256 93af0b3159c00d04ad926a6706d048700fc7a084637689802de25e9746fe6e49

    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