This Streamlit app, powered by Toolhouse AI and OpenAI's LLM, generates Python code to transform data from one JSON format to another. It provides a description of the transformation function and verifies its correctness through automated unit testing.
- Automatically generates Python transformation functions based on input and output JSON examples.
- Provides detailed descriptions of how the function works.
- Verifies the generated code by running unit tests.
- Built with Streamlit for an easy-to-use interface.
You can run the Data Transformation Code Generator app locally or use optional setups like VS Code devcontainer or GitHub Codespaces.
- Toolhouse API Key (get it from https://app.toolhouse.ai/settings/api-keys)
- OpenAI API Key (get it from https://platform.openai.com)
- Clone the repository:
git clone https://github.com/Boburmirzo/ai-data-transformation-code-generator.git
cd ai-data-transformation-code-generator
- Create a .env file in your project directory with the API Keys:
TOOLHOUSE_API_KEY=(key from https://app.toolhouse.ai/settings/api-keys)
OPENAI_API_KEY=(key from https://platform.openai.com)
- Install virtual environment (Preferred)
python3 -m venv env
source env/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Run the Streamlit app:
streamlit run streamlit_app.py
Open your browser and go to http://localhost:8501 to interact with the app.
Click here to open in GitHub Codespaces
Click here to open in Dev Container