Skip to main content

An AI-powered CLI tool for converting DBT SQL files to YAML using OpenAI.

Project description

turboyaml

License

Overview

turboyaml is an AI-powered CLI utility designed to seamlessly convert complex dbt (Data Build Tool) SQL files into YAML format. With the power of OpenAI's advanced GPT-4 language model, this tool empowers data engineers and analysts to accelerate their data modeling and configuration management workflow.

Key Features

  • AI-Powered Precision: Leverage the state-of-the-art OpenAI GPT-4 to ensure accurate and error-free YAML conversion, even for intricate SQL data models.

  • Speed and Efficiency: turboyaml works at lightning speed, delivering YAML output within seconds, saving valuable time for data teams.

  • Multiple File Processing: turboyaml now supports processing multiple dbt SQL files or an entire folder of files in a single command. Simply provide the folder path as the --select option, and turboyaml will process all the .sql files in the folder.

  • Append to Existing YAML: turboyaml can append the generated YAML content to an existing YAML file instead of creating a new one. If the output YAML file already exists, turboyaml will append the new YAML content to it.

Installation

To install turboyaml, use the following command:

pip install turboyaml

Check if the installation was successful:

turboyaml --version

Usage

To harness the full potential of turboyaml in converting dbt SQL files to YAML, simply follow these steps:

  1. Single File Processing

    • Run turboyaml from the command line, providing your OpenAI API key and the path to the dbt SQL file:

      turboyaml --api-key <your_openai_api_key> --select /path/to/your/dbt_file.sql
      
    • If you have an OpenAI API key, provide it using the --api-key option. This method allows you to specify the API key directly in the command.

  2. Multiple File or Folder Processing

    • To process multiple dbt SQL files or an entire folder containing .sql files, provide the folder path as the --select option:

      turboyaml --api-key <your_openai_api_key> --select /path/to/your/dbt_folder/
      
    • If the --select option is a file path, turboyaml will process the single file as before.

    • If the --select option is a folder path, turboyaml will process all the .sql files in the folder.

  3. Appending to Existing YAML

    • To append the generated YAML content to an existing YAML file, provide the YAML file name using the --yaml option:

      turboyaml --api-key <your_openai_api_key> --select /path/to/your/dbt_file.sql --yaml /path/to/your/existing_yaml.yml
      
    • If the --yaml option is not provided, the output YAML file will have the same name as the input dbt SQL file, but with the .yml extension.

  4. Using Environment Variable

    • Alternatively, you can set the OpenAI API key as an environment variable named OPENAI_API_KEY. If the --api-key option is not provided, turboyaml will automatically check for this environment variable and use it if available.

      export OPENAI_API_KEY=<your_openai_api_key>
      
    • By setting the API key as an environment variable, you don't need to provide it explicitly every time you run turboyaml.

Explore dbt SQL Models

For a diverse collection of SQL models and examples, you can explore the official dbt documentation:

The dbt documentation provides detailed information and examples of SQL models from various dbt projects. You can find a wide range of data modeling patterns and best practices that you can use as a reference for your own projects.

Please note that the examples and content in the dbt documentation are subject to the licensing terms specified by dbt.

Contributing

Contributions to turboyaml are welcome! If you'd like to contribute, please read our Contribution Guidelines for more information on how to submit a pull request.

License

turboyaml is open-source software licensed under the MIT License.

Version History

  • 0.0.1 (2023-07-25): Initial release.

  • 0.0.2 (2023-07-26): Added support for processing multiple files and unifying the output in a single YAML file. Implemented the --yaml parameter to specify the YAML output file. Updated the README with new functionalities and disclaimers. Improved error handling and logging.

  • 0.0.3 (2023-07-26): Bug fix and corrected typo

  • 0.0.4 (2023-08-08): Refactor of code and implemented async processing for performance optimization.

Feedback

We value your feedback! If you have any questions, suggestions, or encounter any issues while using turboyaml, please feel free to open an issue or reach out to us.

Experience the power of AI-driven YAML generation with turboyaml. Say hello to a new era of effortless data modeling and configuration management!

Disclaimer

Verify and Review Output The generated YAML output from TurboYAML is produced using AI language models and may contain errors or inaccuracies. It is essential to review and verify the YAML code for correctness and alignment with your specific requirements. Always exercise caution and critical thinking when using the generated output.

Experimental Tool TurboYAML leverages the capabilities of large language models like GPT-4. However, it is important to note that these models are experimental and may occasionally produce incorrect or offensive information. As a user, you should be mindful and careful when relying on the outputs provided by the tool.

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

turboyaml-0.0.4.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

turboyaml-0.0.4-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file turboyaml-0.0.4.tar.gz.

File metadata

  • Download URL: turboyaml-0.0.4.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for turboyaml-0.0.4.tar.gz
Algorithm Hash digest
SHA256 85ad08ce8d86b00db095cdd7f8f35ac8f1b5098df81e1733f1cc39f1d1f62217
MD5 eea69b8f1dcaa483b74b82a626a963e1
BLAKE2b-256 aa8efbbdb065670bb7bf7c0434ca0bf615fda1c17ccc16b3f98465cceb2d1d6d

See more details on using hashes here.

File details

Details for the file turboyaml-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: turboyaml-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for turboyaml-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 619c28c9e76cbd185f77b057e8b75e3486531550cead9b54984c92bc1e80a39e
MD5 e0bf73acc8c75a3fccb184daa5591feb
BLAKE2b-256 a0545960b8cd1a27acbde48c34d134ce357b0a9f50056a34cdfef74f42181065

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