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
-
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
-
Manual Installation:
Copy the
learning_toolboxdirectory into your Python project's directory or somewhere in your Python path.Dependencies:
google-generativeaipdfkitmarkdown2youtube-transcript-apimermaid-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file learning_toolbox-0.2.0.tar.gz.
File metadata
- Download URL: learning_toolbox-0.2.0.tar.gz
- Upload date:
- Size: 35.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcbe96ae72244611f7524a25aac4312fe1419de00d3179f56692bc3b07f0c999
|
|
| MD5 |
16e95f17b528f304a4d3fc03ddb2d5b5
|
|
| BLAKE2b-256 |
0e878ec604b79a976af39bed39c29dbb3da6437bf50705f48c9e0616e3cb5588
|
File details
Details for the file learning_toolbox-0.2.0-py3-none-any.whl.
File metadata
- Download URL: learning_toolbox-0.2.0-py3-none-any.whl
- Upload date:
- Size: 35.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccbf6ca9806dcab2db9c75a139d0b99f1da468b232836d5a0eb8fdc570acad6b
|
|
| MD5 |
ff4044f4a879a858b928b4087f652670
|
|
| BLAKE2b-256 |
d10cecd5790df443df13d4ce0e263ee54fa2627c83f7e6e8b2816b16a2cf6c44
|