Skip to main content

A Python library for processing conversation data, creating Jupyter Notebooks, handling Google Drive uploads, and updating Google Sheets.

Project description

mdtidy

mdtidy is a Python library designed to process conversational AI outputs (specifically GPT and Gemini) into Jupyter Notebooks (.ipynb), while also counting code errors within the content. It's an intuitive tool for transforming raw markdown, code blocks, and conversation data into well-structured Jupyter notebooks, specifically tailored for reviewing AI-generated conversation data and integrating with Google Drive and Google Sheets for enhanced data management.

Features

  • Markdown to Jupyter Notebook: Convert markdown content with embedded Python code blocks into a Jupyter Notebook file.
  • Error Counting: Identify and count common Python error types within the content.
  • Conversation Analysis: Supports parsing and formatting conversation data from both GPT and Gemini models.
  • Google Drive Integration: Upload processed notebooks to Google Drive.
  • Google Sheets Integration: Update Google Sheets with processed conversation data and error counts.

Installation

Install mdtidy using pip:

pip install mdtidy

Usage

Combined Processor

This example shows how to process both GPT and Gemini conversation data into a structured Jupyter notebook all at once.

from mdtidy.combined_processor import process_conversation

# Trigger the processing of a conversation for both models combined, prompting for required details
process_conversation()

Convert GPT Conversations to Notebook

This example shows how to process GPT conversation data into a structured Jupyter notebook.

from mdtidy.gpt_processor import process_gpt_conversation

# Trigger the processing of a GPT conversation, prompting for required details
process_gpt_conversation()

Convert Gemini Conversations to Notebook

This example details processing Gemini model conversations into a notebook format, integrating error analysis.

from mdtidy.gemini_processor import process_gemini_conversation

# Trigger the processing of a Gemini conversation, prompting for required details
process_gemini_conversation()

Count Code Errors

This function identifies and counts typical Python errors within given content.

from mdtidy.gemini_processor import count_code_errors

# Example content with typical Python errors
input_strings_with_errors = [
    """
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'variable' is not defined

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
"""
]

# Count and display code errors
error_counts = count_code_errors(input_strings_with_errors)
print(error_counts)

Update Google Sheets

This feature is currently under development and will be available in a future release.

Once implemented, it will allow you to update Google Sheets with processed conversation data and error counts.

from mdtidy.update_google_sheets import update_google_sheet

# Update the Google Sheet
update_google_sheet()

The update_google_sheet function will automatically use the default directory comp_ana_json for JSON files and the stored Google Sheets credentials and spreadsheet name from the configuration file (google_sheets.ini).

License

This project is licensed under the MIT License.

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

mdtidy-0.4.2.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

mdtidy-0.4.2-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file mdtidy-0.4.2.tar.gz.

File metadata

  • Download URL: mdtidy-0.4.2.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.9

File hashes

Hashes for mdtidy-0.4.2.tar.gz
Algorithm Hash digest
SHA256 2ef35670dd4c52e5c187cf64fe9abdf7e5b22d4ca92d1a3b949555d9df25cef6
MD5 26338fb43967cf05ff66006c8cb85292
BLAKE2b-256 27ccb7c8f0c7d38899adc8a831ed5111fdd51c5293f6830bd718782efd097d7a

See more details on using hashes here.

File details

Details for the file mdtidy-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: mdtidy-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.9

File hashes

Hashes for mdtidy-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c4734350da28a214fc4ced9c050e4ee10991feca7b3fdd9a5029876ddda86e5
MD5 a90190543f71f6fa3f44a9cd7c53611b
BLAKE2b-256 3f0e08ca5415c96094765c64c4d2ba1f40529512ae7d115941755c38a9673ea4

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