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-codecommand generates both the function code and the test code based on the provided description. - The
testcommand 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b1b5e58452cc722e3fc01b749a81238e96065acab2b9566695cf0a381ccf9ca
|
|
| MD5 |
4d97be9b566b4877b23040621526cd76
|
|
| BLAKE2b-256 |
47a1380480cdd533bf742fe3ff68cbce715ee92918add0a2d139bcd25e83a216
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5986a777c8531072f226adfd5f090615701f9b26be83dbde6f41b15b3dd1184
|
|
| MD5 |
e42be3ede46fe9b9ebea49f1a5891e5b
|
|
| BLAKE2b-256 |
f0dcc01e84315fab557aa78b9980515e352279314ec1bc8b8a02c516b6184b3f
|