Skip to main content

A utility to assist in building Test-Driven Python code using Langchain and OpenAI.

Project description

ChatTDD

ChatTDD is a Python utility designed to assist developers in building Test-Driven Python code. By leveraging the OpenAI API, ChatTDD automates the generation of function code and corresponding tests based on a simple textual description of the desired functionality.

Installation

To install ChatTDD, ensure you have Python 3.9 installed, then run the following command:

pip install ChatTDD

Configuration

Before using ChatTDD, you'll need to have an OpenAI API key. If you don't have one, you can obtain it from OpenAI.

On the first run, ChatTDD will prompt you to enter your OpenAI API key, which will be saved for future use.

Usage

ChatTDD provides two main commands: test-and-code and test.

  • The test-and-code command generates both the function code and the test code based on the provided description.
  • The test command generates only the test code.

Here's how you can use these commands:

Generate Function and Test Code

chattdd test-and-code "sort a list of objects alphabetically"

Generate Only Test Code

chattdd test "sort a list of objects alphabetically"

ChatTDD will create the necessary Python files under the src and tests directories respectively.

Contributing

If you'd like to contribute to the development of ChatTDD, please feel free to fork the repository and submit a pull request.

License

ChatTDD is licensed under the MIT License. See the LICENSE file for more 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

ChatTDD-0.1.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

ChatTDD-0.1.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file ChatTDD-0.1.3.tar.gz.

File metadata

  • Download URL: ChatTDD-0.1.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for ChatTDD-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0b1b5e58452cc722e3fc01b749a81238e96065acab2b9566695cf0a381ccf9ca
MD5 4d97be9b566b4877b23040621526cd76
BLAKE2b-256 47a1380480cdd533bf742fe3ff68cbce715ee92918add0a2d139bcd25e83a216

See more details on using hashes here.

File details

Details for the file ChatTDD-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ChatTDD-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for ChatTDD-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b5986a777c8531072f226adfd5f090615701f9b26be83dbde6f41b15b3dd1184
MD5 e42be3ede46fe9b9ebea49f1a5891e5b
BLAKE2b-256 f0dcc01e84315fab557aa78b9980515e352279314ec1bc8b8a02c516b6184b3f

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