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.4.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.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ChatTDD-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 b97aabccebbfefd85ae5b40bbd521cec5605e44086b2124fa799782a4d5d0460
MD5 9163462855d64a89c11de9e203ddcaa7
BLAKE2b-256 1188c8ab834b2472d40b492e6cc274134d77b461ffe31abc0ff817e17ac92c5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ChatTDD-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4fab11cfec113d5e5e05cc63401ff6699c0f6e51ae2fe1c9bfe7841e8080633b
MD5 f6a8e08401a7bb11cc15fa2c8d2b7114
BLAKE2b-256 91a40d5ef8d49bc5726d8ecc53939ddd4d7060f800064d66f1937ceed20394c0

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