Skip to main content

A Python library for generating learning resources using Gemini AI and other tools.

Project description

Learning Toolbox Library

A Python library for generating learning resources like notes, quizzes, YouTube summaries, and mind maps using the Gemini AI and other tools.

Installation

  1. Install via pip (recommended):

    If you create a setup.py (see below), you can install the library using pip:

     pip install learning-toolbox
     npm install -g @mermaid-js/mermaid-cli
    
  2. Manual Installation:

    Copy the learning_toolbox directory into your Python project's directory or somewhere in your Python path.

    Dependencies:

    • google-generativeai
    • pdfkit
    • markdown2
    • youtube-transcript-api
    • mermaid-cli (must be installed separately on your system for mind maps)
    npm install -g @mermaid-js/mermaid-cli
    

    Install dependencies using pip:

    pip install google-generativeai pdfkit markdown2 youtube-transcript-api
    

Usage

Here's how to use the learning_toolbox library in your Python project:

from learning_toolbox import generate_content, save_files

# Set your Gemini API key (replace with your actual key or set as environment variable)
api_key = 'YOUR_GEMINI_API_KEY'

# Example 1: Generate study notes
topic_notes = "Quantum Physics"
notes_content = generate_content(topic_notes, content_type="notes", api_key=api_key)
if notes_content and not notes_content.startswith("Error"):
    md_notes_file, pdf_notes_file = save_files(topic_notes, notes_content, content_type="notes", base_dir="./output_resources")
    print(f"Notes saved to: {md_notes_file}, {pdf_notes_file}")
else:
    print(f"Error generating notes: {notes_content}")


# Example 2: Generate a quiz
topic_quiz = "Python Programming Basics"
quiz_content = generate_content(topic_quiz, content_type="quiz", api_key=api_key)
if quiz_content and not quiz_content.startswith("Error"):
    md_quiz_file, pdf_quiz_file = save_files(topic_quiz, quiz_content, content_type="quiz", base_dir="./output_resources")
    print(f"Quiz saved to: {md_quiz_file}, {pdf_quiz_file}")
else:
    print(f"Error generating quiz: {quiz_content}")

# Example 3: Summarize a YouTube video
youtube_url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" # Replace with a real video URL
summary_content = generate_content(youtube_url, content_type="youtube_summary", api_key=api_key)
if summary_content and not summary_content.startswith("Error"):
    md_summary_file, pdf_summary_file = save_files(youtube_url, summary_content, content_type="youtube_summary", base_dir="./output_resources")
    print(f"YouTube summary saved to: {md_summary_file}, {pdf_summary_file}")
else:
    print(f"Error generating YouTube summary: {summary_content}")

# Example 4: Generate a mind map
topic_mindmap = "Web Development Fundamentals"
mindmap_content = generate_content(topic_mindmap, content_type="mindmap", api_key=api_key)
if mindmap_content and not mindmap_content.startswith("Error"):
    mindmap_image_file, _ = save_files(topic_mindmap, mindmap_content, content_type="mindmap", base_dir="./output_resources") # pdf_file will be None for mindmap
    print(f"Mind map saved to: {mindmap_image_file}")
else:
    print(f"Error generating mind map: {mindmap_content}")

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

learning_toolbox-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

learning_toolbox-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file learning_toolbox-0.1.0.tar.gz.

File metadata

  • Download URL: learning_toolbox-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for learning_toolbox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6fee2da4526cc4a15f2747daa9e56eba98a01a33a54e542e05920c78d301334
MD5 078903485267ccb20adf322a154639db
BLAKE2b-256 884ff1ea71292601f553a41475be6f0c97e4144e1c9065a20173decb0e6cfa37

See more details on using hashes here.

File details

Details for the file learning_toolbox-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for learning_toolbox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99a0ca46e52f0ced26c2a2cdbab31d7ddb26a0663ae40d978e803ea0c269e5e3
MD5 839d3b56db400b8703f529893c07c165
BLAKE2b-256 d50363cfa24af25067902e44309717947df00b3b63a18c8868b92c575671a1d7

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