Skip to main content

A package for generating code snippets using GPT-3.5-turbo, developed with pyenv, built with build using setuptools, uploaded to PyPI using twine, and distributed via pip.

Project description

Python build & test

GPT Coder

Description

This package is designed to help users write better and more fun code. It allows users to modify the conciseness, commenting, and readability of the code returned by the GPT model. Through the usage of this package, users can expect code responses that are more tailored towards their preferences.

Instructions

Ensure that you already have pipenv installed. If not, you can install it by running the following command:

pip install pipenv

In order to use our package, run this line in your terminal:

pip install gptcoder

Then, add this line to the top of your file:

from gptcoder import GPTCoder

Functions

  1. set_language

    • Description: This function sets the language of the code to be generated.
    • Parameters:
      • language_code: int
        • Description: The code corresponding to the programming language of the code to be generated.
        • Values: 1. Python, 2. JavaScript, 3. Java, 4. C, 5. C++, 6. C#, 7. TypeScript, 8. PHP, 9. Swift, 10. Ruby
        • Default: 1
  2. set_conciseness

    • Description: This function sets the conciseness of the code to be generated.
    • Parameters:
      • conciseness: int
        • Description: The conciseness of the code to be generated.
        • Values: 1-10
        • Default: 1
  3. set_commenting

    • Description: This function sets the commenting of the code to be generated.
    • Parameters:
      • commenting: int
        • Description: The commenting of the code to be generated.
        • Values: 1-10
        • Default: 5
  4. set_readability

    • Description: This function sets the readability of the code to be generated.
    • Parameters:
      • readability: int
        • Description: The readability of the code to be generated.
        • Values: 1-10
        • Default: 10
  5. generate_code

    • Description: This function generates code based on the given prompt.
    • Parameters:
      • code_prompt: str
        • Description: The prompt for the code to be generated.
        • Values: Any string
        • Default: None

Contributing

To contribute to this project, follow these steps:

  1. Set up the virtual environment

    pip install pipenv
    cd path/to/project
    pipenv shell
    
  2. Install dependencies:

    Our project's dependencies are listed in the Pipfile. You can install them with pipenv:

    pipenv install gptcoder
    
  3. Build the package:

    The package can be built using the pyproject.toml file, which contains the build system (poetry) and the project metadata. To build the package, run:

    python3 -m build
    

How to run unit tests

Simple example unit tests are included within the tests directory. To run the tests:

  1. Install pytest in a virtual environment.
  2. Run the tests from the main project directory: python3 -m pytest.
  3. Tests should never fail.

Demo

Demo Program

Team Members

Package Page

gptcoder on PyPi

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

gptcoder-0.1.5.tar.gz (43.0 kB view hashes)

Uploaded Source

Built Distribution

gptcoder-0.1.5-py3-none-any.whl (29.0 kB view hashes)

Uploaded Python 3

Supported by

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