{"id":28363287,"url":"https://github.com/aadya940/pycoding","last_synced_at":"2025-07-19T22:03:36.703Z","repository":{"id":274467096,"uuid":"923001333","full_name":"aadya940/pycoding","owner":"aadya940","description":"An Agentic Python Library and CLI Tool to automate Coding tutorial generation.","archived":false,"fork":false,"pushed_at":"2025-03-25T13:55:18.000Z","size":108,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T21:40:59.518Z","etag":null,"topics":["agent","agentic-ai","ai","artificial-intelligence","automation","coding","content","python","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aadya940.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-27T13:28:54.000Z","updated_at":"2025-03-25T13:55:21.000Z","dependencies_parsed_at":"2025-02-13T07:39:10.093Z","dependency_job_id":null,"html_url":"https://github.com/aadya940/pycoding","commit_stats":null,"previous_names":["aadya940/pycoding"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aadya940/pycoding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadya940%2Fpycoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadya940%2Fpycoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadya940%2Fpycoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadya940%2Fpycoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aadya940","download_url":"https://codeload.github.com/aadya940/pycoding/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadya940%2Fpycoding/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266026163,"owners_count":23866030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agentic-ai","ai","artificial-intelligence","automation","coding","content","python","tutorial"],"created_at":"2025-05-28T17:14:41.185Z","updated_at":"2025-07-19T22:03:36.679Z","avatar_url":"https://github.com/aadya940.png","language":"Python","readme":"# **Pycoding**\n\n[Example Tutorial](https://github.com/user-attachments/assets/a6a7110d-6f13-47cb-b968-0aad3db89335)\n\n## **Automated Coding Tutorial Generation with Audio Narration**\n\n**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.\n\n---\n\n## **Key Features**\n\n- **AI-Powered Code Generation**: Uses Google's Generative AI to create relevant code examples\n- **Natural Voice Narration**: Integrates with ElevenLabs for high-quality voice synthesis\n- **Real-Time Screen Recording**: Captures live coding demonstrations\n- **Multi-Language Support**: Works with multiple programming languages\n- **Flexible Narration Modes**: Supports both real-time and post-processed narration\n- **Title Slide Generation**: Optional title slides for each code segment\n- **Automated Window Management**: Handles Jupyter console and matplotlib windows automatically\n- **Flowchart Visualizations**: Optional flowchart visualizations for code logic\n\n## **Supported Languages**\n\nPycoding supports generating tutorials in the following programming languages:\n\n- **Python** (`python3`)\n- **C/C++** (`xcpp17`)\n- **Julia** (`julia`)\n- **Rust** (`rust`)\n- **Bash** (`bash`)\n- **R** (`r`)\n\n---\n\n## **Prerequisites**\n\nBefore installing Pycoding, ensure you have the following:\n\n### **System Requirements**\n- Linux operating system (currently Linux-only)\n- `ffmpeg` for audio/video processing\n- `wmctrl` and `xwininfo` for window management\n- `gnome-terminal` for terminal emulation\n- Jupyter installation with required language kernels\n- `graphviz` for flowchart generation\n\n### **API Requirements**\n- Google Generative AI API key\n- ElevenLabs API key and voice ID\n\n### **Python Dependencies**\nCore dependencies include:\n```\nffmpeg-python\ngoogle-generativeai\npydub\nsimpleaudio\npyautogui\npynput\nrich \nelevenlabs\njupyter\nipython\npycaw\ncomtypes\npygetwindow\nmoviepy\nopencv-python\n```\n\n---\n\n## **Installation**\n\n1. **Clone the Repository**\n```bash\ngit clone https://github.com/aadya940/pycoding.git\ncd pycoding\n```\n\n2. **Install Dependencies**\n```bash\npython3 -m pip install -r requirements.txt\n```\n\n3. **Install System Dependencies**\n```bash\n# For Ubuntu/Debian\nsudo apt-get install ffmpeg graphviz\n\n# For Fedora\nsudo dnf install ffmpeg graphviz\n\n# For Arch Linux\nsudo pacman -S ffmpeg graphviz\n```\n\n4. **Install the Library**\n```bash\npython3 -m pip install .\n```\n\n4. **Configure Jupyter Kernels**\nSee [README_kernels.md](README_kernels.md) for detailed instructions on setting up language kernels.\n\n---\n\n## **Usage**\n\n### **Command Line Interface**\n\nGenerate a coding tutorial using the command line:\n\n```bash\npython3 -m pycoding \\\n    --topic \"Your Tutorial Topic\" \\\n    --google-api-key YOUR_GOOGLE_API_KEY \\\n    --elevenlabs-api-key YOUR_ELEVENLABS_API_KEY \\\n    --elevenlabs-voice-id YOUR_ELEVENLABS_VOICE_ID \\\n    --narration-type parallel \\\n    --language python3 \\\n    --force-approve \\\n    --add-titles \\\n    --add-flowchart \\\n    --io-path /path/to/example/code\n```\n\n### **Python API**\n\n```python\nfrom pycoding import CodingTutorial, GoogleGenAI\n\n# Initialize AI model\nmodel = GoogleGenAI(google_api_key)\n\n# Create tutorial\ntutorial = CodingTutorial(\n    topic=\"Your Tutorial Topic\",\n    eleven_labs_api_key=\"YOUR_ELEVENLABS_API_KEY\",\n    eleven_labs_voice_id=\"YOUR_ELEVENLABS_VOICE_ID\",\n    model_object=model,\n    path_info=[],  # Optional paths for code context\n    narration_type=\"parallel\",  # or \"after\"\n    language=\"python3\",\n    force_approve=False,  # Set to True to skip manual approvals\n    add_titles=True,  # Add title slides\n    add_flowchart=True,  # Add flowchart visualization\n    io_path=\"/path/to/example/code\"  # Specify paths for code generation context\n)\n\n# Generate the tutorial\ntutorial.make_tutorial()\n```\n\n### **Command Line Options**\n\n| **Flag**                   | **Description** |\n|----------------------------|----------------|\n| `--topic`                  | Tutorial topic |\n| `--google-api-key`         | Google Generative AI API key |\n| `--elevenlabs-api-key`     | ElevenLabs API key |\n| `--elevenlabs-voice-id`    | ElevenLabs voice ID |\n| `--io-path`                | Paths for code context (optional) |\n| `--narration-type`         | Narration mode: `parallel` or `after` |\n| `--language`               | Programming language |\n| `--force-approve`          | Skip manual approvals |\n| `--add-titles`             | Add title slides |\n| `--add-flowchart`          | Add flowchart visualization |\n\n---\n\n## **Output**\n\nThe generated tutorial includes:\n- Screen recording of code typing and execution\n- AI-generated voice narration\n- Optional title slides\n- Optional flowchart visualizations\n- Synchronized audio and video\n- Output files in `pycoding_data/` directory\n\n---\n\n## **Examples**\n\n### **Basic Python Tutorial**\n```bash\npython3 -m pycoding \\\n    --topic \"Python List Comprehensions in 3 Examples\" \\\n    --google-api-key YOUR_KEY \\\n    --elevenlabs-api-key YOUR_KEY \\\n    --elevenlabs-voice-id YOUR_ID \\\n    --language python3\n```\n\n### **C++ Tutorial with Titles and Flowchart**\n```bash\npython3 -m pycoding \\\n    --topic \"Understanding C++ Templates\" \\\n    --google-api-key YOUR_KEY \\\n    --elevenlabs-api-key YOUR_KEY \\\n    --elevenlabs-voice-id YOUR_ID \\\n    --language xcpp17 \\\n    --add-titles \\\n    --add-flowchart\n```\n\n---\n\n## **Limitations**\n\n- Currently supports Linux environments only\n- Requires specific window management utilities\n- API keys needed for AI services\n- Language kernels must be properly configured\n\n---\n\n## **Contributing**\n\nContributions 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.\n\n---\n\n## **Author**\n\nAadya Chinubhai\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadya940%2Fpycoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faadya940%2Fpycoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadya940%2Fpycoding/lists"}