https://github.com/aadya940/pycoding

An Agentic Python Library and CLI Tool to automate Coding tutorial generation.

https://github.com/aadya940/pycoding

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary

Keywords

agent agentic-ai ai artificial-intelligence automation coding content python tutorial
Last synced: 7 months ago · JSON representation

Repository

An Agentic Python Library and CLI Tool to automate Coding tutorial generation.

Basic Info
  • Host: GitHub
  • Owner: aadya940
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 105 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
agent agentic-ai ai artificial-intelligence automation coding content python tutorial
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

Pycoding

Example Tutorial

Automated Coding Tutorial Generation with Audio Narration

Pycoding is an agentic Python library designed to generate fully automated, natural-looking coding tutorials with real-time or post-processed audio narration. It combines AI-powered code generation, screen recording, and voice synthesis to create engaging programming tutorials.


Key Features

  • AI-Powered Code Generation: Uses Google's Generative AI to create relevant code examples
  • Natural Voice Narration: Integrates with ElevenLabs for high-quality voice synthesis
  • Real-Time Screen Recording: Captures live coding demonstrations
  • Multi-Language Support: Works with multiple programming languages
  • Flexible Narration Modes: Supports both real-time and post-processed narration
  • Title Slide Generation: Optional title slides for each code segment
  • Automated Window Management: Handles Jupyter console and matplotlib windows automatically
  • Flowchart Visualizations: Optional flowchart visualizations for code logic

Supported Languages

Pycoding supports generating tutorials in the following programming languages:

  • Python (python3)
  • C/C++ (xcpp17)
  • Julia (julia)
  • Rust (rust)
  • Bash (bash)
  • R (r)

Prerequisites

Before installing Pycoding, ensure you have the following:

System Requirements

  • Linux operating system (currently Linux-only)
  • ffmpeg for audio/video processing
  • wmctrl and xwininfo for window management
  • gnome-terminal for terminal emulation
  • Jupyter installation with required language kernels
  • graphviz for flowchart generation

API Requirements

  • Google Generative AI API key
  • ElevenLabs API key and voice ID

Python Dependencies

Core dependencies include: ffmpeg-python google-generativeai pydub simpleaudio pyautogui pynput rich elevenlabs jupyter ipython pycaw comtypes pygetwindow moviepy opencv-python


Installation

  1. Clone the Repository bash git clone https://github.com/aadya940/pycoding.git cd pycoding

  2. Install Dependencies bash python3 -m pip install -r requirements.txt

  3. Install System Dependencies ```bash

    For Ubuntu/Debian

    sudo apt-get install ffmpeg graphviz

For Fedora

sudo dnf install ffmpeg graphviz

For Arch Linux

sudo pacman -S ffmpeg graphviz ```

  1. Install the Library bash python3 -m pip install .

  2. Configure Jupyter Kernels See README_kernels.md for detailed instructions on setting up language kernels.


Usage

Command Line Interface

Generate a coding tutorial using the command line:

bash python3 -m pycoding \ --topic "Your Tutorial Topic" \ --google-api-key YOUR_GOOGLE_API_KEY \ --elevenlabs-api-key YOUR_ELEVENLABS_API_KEY \ --elevenlabs-voice-id YOUR_ELEVENLABS_VOICE_ID \ --narration-type parallel \ --language python3 \ --force-approve \ --add-titles \ --add-flowchart \ --io-path /path/to/example/code

Python API

```python from pycoding import CodingTutorial, GoogleGenAI

Initialize AI model

model = GoogleGenAI(googleapikey)

Create tutorial

tutorial = CodingTutorial( topic="Your Tutorial Topic", elevenlabsapikey="YOURELEVENLABSAPIKEY", elevenlabsvoiceid="YOURELEVENLABSVOICEID", modelobject=model, pathinfo=[], # Optional paths for code context narrationtype="parallel", # or "after" language="python3", forceapprove=False, # Set to True to skip manual approvals addtitles=True, # Add title slides addflowchart=True, # Add flowchart visualization io_path="/path/to/example/code" # Specify paths for code generation context )

Generate the tutorial

tutorial.make_tutorial() ```

Command Line Options

| Flag | Description | |----------------------------|----------------| | --topic | Tutorial topic | | --google-api-key | Google Generative AI API key | | --elevenlabs-api-key | ElevenLabs API key | | --elevenlabs-voice-id | ElevenLabs voice ID | | --io-path | Paths for code context (optional) | | --narration-type | Narration mode: parallel or after | | --language | Programming language | | --force-approve | Skip manual approvals | | --add-titles | Add title slides | | --add-flowchart | Add flowchart visualization |


Output

The generated tutorial includes: - Screen recording of code typing and execution - AI-generated voice narration - Optional title slides - Optional flowchart visualizations - Synchronized audio and video - Output files in pycoding_data/ directory


Examples

Basic Python Tutorial

bash python3 -m pycoding \ --topic "Python List Comprehensions in 3 Examples" \ --google-api-key YOUR_KEY \ --elevenlabs-api-key YOUR_KEY \ --elevenlabs-voice-id YOUR_ID \ --language python3

C++ Tutorial with Titles and Flowchart

bash python3 -m pycoding \ --topic "Understanding C++ Templates" \ --google-api-key YOUR_KEY \ --elevenlabs-api-key YOUR_KEY \ --elevenlabs-voice-id YOUR_ID \ --language xcpp17 \ --add-titles \ --add-flowchart


Limitations

  • Currently supports Linux environments only
  • Requires specific window management utilities
  • API keys needed for AI services
  • Language kernels must be properly configured

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.


Author

Aadya Chinubhai

Owner

  • Name: Aadya Chinubhai
  • Login: aadya940
  • Kind: user

UG. Student at Ahmedabad University.

GitHub Events

Total
  • Issues event: 2
  • Delete event: 2
  • Push event: 48
  • Create event: 4
Last Year
  • Issues event: 2
  • Delete event: 2
  • Push event: 48
  • Create event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 68
  • Total Committers: 1
  • Avg Commits per committer: 68.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 68
  • Committers: 1
  • Avg Commits per committer: 68.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
aadya940 a****a@u****i 68
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: about 21 hours
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: about 21 hours
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • aadya940 (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • elevenlabs *
  • ffmpeg *
  • google-generativeai *
  • pyautogui *
  • pydub *
  • rich *
  • simpleaudio *
setup.py pypi