{"id":27286680,"url":"https://github.com/gnanesh-16/dhvagna","last_synced_at":"2025-04-11T19:43:49.622Z","repository":{"id":286408469,"uuid":"961298572","full_name":"gnanesh-16/Dhvagna","owner":"gnanesh-16","description":"Dhwagna is a Python package that simplifies audio-to-text transcription using a large language model (LLM). It requires just 7 lines of code for basic use and 22 for advanced features, making it far more efficient than other packages, which often need 200+ lines for optimization.","archived":false,"fork":false,"pushed_at":"2025-04-07T14:59:02.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T15:36:05.334Z","etag":null,"topics":["audio-processing","dhvagna","llm","machine-learning","package","python","software-engineering"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/dhvagna/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnanesh-16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-04-06T07:56:35.000Z","updated_at":"2025-04-07T14:59:06.000Z","dependencies_parsed_at":"2025-04-07T15:48:21.757Z","dependency_job_id":null,"html_url":"https://github.com/gnanesh-16/Dhvagna","commit_stats":null,"previous_names":["gnanesh-16/dhwagna","gnanesh-16/dhvagna"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnanesh-16%2FDhvagna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnanesh-16%2FDhvagna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnanesh-16%2FDhvagna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnanesh-16%2FDhvagna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnanesh-16","download_url":"https://codeload.github.com/gnanesh-16/Dhvagna/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248468874,"owners_count":21108905,"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":["audio-processing","dhvagna","llm","machine-learning","package","python","software-engineering"],"created_at":"2025-04-11T19:43:48.903Z","updated_at":"2025-04-11T19:43:49.614Z","avatar_url":"https://github.com/gnanesh-16.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dhvagna\n\n![Version](https://img.shields.io/badge/version-0.1.2-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![Python](https://img.shields.io/badge/python-3.7%2B-blue)\n\nA powerful multilingual voice transcription tool that supports both Telugu and English speech, powered by Google's Gemini AI. Dhvagna makes it easy to transcribe speech from both recordings and live microphone input, with support for customizable prompts and formatting.\n\n## 🔑 API Key Required\n\nTo use Dhvagna, you need a valid API key with the following requirements:\n\n- **Valid API key format**: All API keys must start with `dk-` followed by a unique alphanumeric string\n- **Limited usage**: Each API key is limited to 100 transcriptions\n- **Verification**: API keys are verified with our servers\n\n### How to obtain an API key:\n\nVisit [https://github.com/gnanesh-16/Dhvagna](https://github.com/gnanesh-16/Dhvagna) to register and receive your API key. or Here is the Free *DHVAGNA_API_KEY = \"dk-uahdh8374hasjojnufouahe74\" has upto (10 tokens availablity)\n\n### Setting up your API key:\n\n```bash\n# On Windows (Command Prompt)\nset DHVGNA_API_KEY=dk-your_unique_key_here\n\n# On Windows (PowerShell)\n$env:DHVGNA_API_KEY=\"dk-your_unique_key_here\"\n\n# On Linux/MacOS\nexport DHVGNA_API_KEY=\"dk-your_unique_key_here\"\n```\n\nAlternatively, you can create a `.env` file in your project directory:\n\n```\nDHVGNA_API_KEY=dk-your_unique_key_here\n```\n\n### Usage tracking:\n\nThe package tracks usage against your API key quota. You'll receive notifications about:\n\n- Remaining transcriptions at startup\n- Updated count after each transcription\n- Errors when your limit is reached\n\n## 🌟 Features\n\n- **Multilingual Support**: Transcribe both Telugu and English speech with high accuracy\n- **Multiple Input Methods**:\n  - Live microphone recording with simple keyboard controls\n  - Process existing WAV audio files\n- **Smart Language Detection**: Automatically detects whether the speech is in Telugu or English\n- **Advanced Processing**:\n  - Raw transcription preserving original speech patterns\n  - Refined output with improved grammar and formatting\n  - Customizable prompts for different use cases\n- **Flexible Output**:\n  - Customizable title formatting\n  - Both raw and refined transcriptions\n  - Automatic file saving with timestamps\n- **Easy-to-Use Interface**:\n  - Simple keyboard controls ('K' to start/stop recording)\n  - Progress indicators and timers\n  - Beautiful console output with color coding\n- **API Key Management**:\n  - Secure API key validation\n  - Usage tracking with quota limits\n  - Graceful error handling for exceeded quotas\n\n## 📦 Installation\n\n```bash\npip install dhvagna\n```\n\n## 🚀 Quick Start\n\n### Basic Usage\n\n```python\nfrom dhvagna import record_audio, transcribe_wav_file\n\n# Make sure you've set your DHVGNA_API_KEY environment variable first!\n# The key must start with 'dk-' and be registered with our service\n\n# Record and transcribe from microphone\nrecord_audio()\n\n# Or transcribe an existing WAV file\nresult = transcribe_wav_file(\"path/to/audio.wav\")\n```\n\n## 📝 Examples\n\nThe package includes several example scripts to help you get started:\n\n### 1. Basic Example\n\n```python\n# basic_example.py\nimport os\nfrom dhvagna import record_audio, transcribe_wav_file\n\ndef check_api_key():\n    \"\"\"Check if API key is properly set\"\"\"\n    api_key = os.getenv('DHVGNA_API_KEY')\n    if not api_key:\n        print(\"\\n❌ Error: DHVGNA_API_KEY environment variable not found!\")\n        print(\"\\nTo set your API key:\")\n        print(\"1. Get your API key from: https://github.com/gnanesh-16/Dhwagna\")\n        print(\"\\n2. Set it as an environment variable:\")\n        print(\"   Windows (Command Prompt):\")\n        print(\"   set DHVGNA_API_KEY=your_api_key_here\")\n        return False\n    return True\n\ndef main():\n    print(\"===== Dhvagna Basic Usage Example =====\")\n    \n    # First, verify API key is set\n    if not check_api_key():\n        return\n    \n    # Present options to user\n    print(\"\\nWhat would you like to do?\")\n    print(\"1. Record audio from microphone\")\n    print(\"2. Transcribe a WAV file\")\n    \n    choice = input(\"\\nEnter your choice (1 or 2): \")\n    \n    if choice == \"1\":\n        print(\"\\nPress 'K' to start recording\")\n        print(\"Press 'K' again to stop recording\")\n        record_audio()\n        \n    elif choice == \"2\":\n        file_path = input(\"\\nEnter the path to your WAV file: \")\n        if file_path.strip():\n            result = transcribe_wav_file(file_path.strip())\n            if result:\n                original, refined, language = result\n                print(f\"\\nTranscription successful!\")\n                print(f\"Detected language: {language}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### 2. Simple Example\n\n```python\n# simple_example.py\nimport os\nfrom dhvagna import record_audio, transcribe_wav_file, set_custom_prompts\n\ndef verify_api_key():\n    \"\"\"Make sure API key is set up correctly\"\"\"\n    api_key = os.getenv('DHVGNA_API_KEY')\n    if not api_key:\n        print(\"\\n❌ Error: DHVGNA_API_KEY not found!\")\n        print(\"\\nGet your API key from:\")\n        print(\"https://github.com/gnanesh-16/Dhwagna\")\n        return False\n    if not api_key.startswith('dk'):\n        print(\"\\n❌ Error: Invalid API key format!\")\n        print(\"Dhvagna API keys must start with 'dk'\")\n        return False\n    return True\n\ndef main():\n    print(\"===== Dhvagna Quick Start =====\")\n    \n    # Check API key first\n    if not verify_api_key():\n        return\n    \n    # Set up a simple custom prompt (optional)\n    custom_prompt = \"\"\"\nTranscribe this content in Telugu or English.\nIdentify the language as [LANGUAGE: Telugu] or [LANGUAGE: English].\nCapture the speech exactly as spoken.\n\"\"\"\n    set_custom_prompts(new_transcription_prompt=custom_prompt)\n    \n    # Show options\n    print(\"\\nWhat would you like to do?\")\n    print(\"1. Record new audio\")\n    print(\"2. Transcribe WAV file\")\n    \n    choice = input(\"\\nChoice (1 or 2): \")\n    \n    if choice == \"1\":\n        print(\"\\nRecording:\")\n        print(\"1. Press 'K' to start\")\n        print(\"2. Speak your content\")\n        print(\"3. Press 'K' again to stop\")\n        record_audio()\n    \n    elif choice == \"2\":\n        file_path = input(\"\\nEnter WAV file path: \")\n        if file_path.strip():\n            print(\"\\nTranscribing file...\")\n            transcribe_wav_file(file_path.strip())\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### 3. Prompt Customization Example\n\n```python\n# prompt_customization_example.py\nimport os\nfrom dhvagna import (\n    record_audio, \n    transcribe_wav_file, \n    set_custom_prompts,\n    reset_prompts,\n    DEFAULT_TRANSCRIPTION_PROMPT,\n    DEFAULT_REFINEMENT_PROMPT_TEMPLATE,\n    DEFAULT_TITLE_FORMAT\n)\n\n# View and customize different aspects of transcription\ndef main():\n    print(\"===== Dhvagna Customization Example =====\")\n    \n    # First, verify API key is set\n    if not check_api_key():\n        return\n    \n    # Let's customize for technical documentation\n    technical_prompt = \"\"\"\nTranscribe this technical content. The speech may be in Telugu or English.\nIdentify the language and indicate it with [LANGUAGE: Telugu] or [LANGUAGE: English].\nFocus on capturing:\n- Code snippets and technical terms\n- API references and documentation\n- Software architecture descriptions\n\"\"\"\n    \n    technical_template = \"\"\"\nHere is a technical transcription in {language}: \"{text}\"\n\nPlease refine this text while:\n1. Maintaining all technical terms and code references exactly\n2. Using proper technical writing style\n3. Organizing content logically\n\"\"\"\n    \n    technical_title = \"💻 Technical {language} Documentation\"\n    \n    # Set all custom options\n    set_custom_prompts(\n        new_transcription_prompt=technical_prompt,\n        new_refinement_prompt_template=technical_template,\n        new_title_format=technical_title\n    )\n    \n    # Try the custom settings\n    print(\"\\nPress 'K' to start recording technical documentation\")\n    print(\"Press 'K' again to stop\")\n    record_audio()\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### 4. Advanced Example\n\n```python\n# advanced_example.py\nimport os\nfrom rich.console import Console\nfrom rich.panel import Panel\nfrom dhvagna import (\n    record_audio, \n    transcribe_wav_file, \n    set_custom_prompts,\n    reset_prompts\n)\n\n# Create Rich console for beautiful output\nconsole = Console()\n\nclass TranscriptionProfile:\n    \"\"\"Represents a complete transcription configuration profile\"\"\"\n    def __init__(self, name, prompt, template, title_format, description):\n        self.name = name\n        self.prompt = prompt\n        self.template = template\n        self.title_format = title_format\n        self.description = description\n    \n    def apply(self):\n        \"\"\"Apply this profile's settings\"\"\"\n        set_custom_prompts(\n            new_transcription_prompt=self.prompt,\n            new_refinement_prompt_template=self.template,\n            new_title_format=self.title_format\n        )\n\n# Define specialized transcription profiles\nPROFILES = {\n    \"academic\": TranscriptionProfile(\n        name=\"Academic\",\n        prompt=\"\"\"\nTranscribe this academic content with high precision. The speech may be in Telugu or English.\nIdentify the language and indicate it with [LANGUAGE: Telugu] or [LANGUAGE: English].\nFocus on capturing:\n- Technical and academic terminology\n- Research methodologies and findings\n- Statistical data and measurements\n\"\"\",\n        template=\"\"\"\nHere is an academic transcription in {language}: \"{text}\"\n\nPlease refine this content while:\n1. Maintaining academic rigor and technical accuracy\n2. Preserving all citations and references\n3. Structuring into proper academic sections\n\"\"\",\n        title_format=\"🎓 Academic {language} Transcript\",\n        description=\"Optimized for research presentations, lectures, and academic discussions\"\n    ),\n    \n    # Additional profiles defined for medical and legal transcription\n    # ...\n}\n\ndef main():\n    console.print(Panel(\n        \"[bold cyan]Welcome to the Advanced Dhvagna Example![/]\\n\\n\"\n        \"This example demonstrates all features including:\\n\"\n        \"• Specialized transcription profiles\\n\"\n        \"• Custom formatting options\\n\"\n        \"• Multiple use cases\\n\"\n        \"• Profile switching\",\n        title=\"🚀 Advanced Features Demo\",\n        border_style=\"green\"\n    ))\n    \n    # Apply profile and record\n    profile = PROFILES[\"academic\"]\n    profile.apply()\n    console.print(f\"\\n[green]✓[/] Applied [bold]{profile.name}[/] profile!\")\n    \n    console.print(\"\\nPress 'K' to start recording\")\n    console.print(\"Press 'K' again to stop\")\n    record_audio()\n\nif __name__ == \"__main__\":\n    main()\n```\n\nEach example is located in the `dhvagna/examples/` directory and demonstrates different aspects of using the Dhvagna package.\n\n## 🛠️ API Key Troubleshooting\n\nIf you encounter API key issues:\n\n- **Invalid key format**: Ensure your key starts with `dk-`\n- **Verification failure**: Check that your key is registered in our system\n- **Usage limit exceeded**: Contact us to upgrade your plan if you need more than 100 transcriptions\n- **Server connection issues**: The package will run in offline mode with limited functionality if it can't connect to our servers\n\n## 🎯 Use Cases\n\n### Academic Research\n- Transcribe research presentations\n- Document academic discussions\n- Record seminar content\n\n### Medical Transcription\n- Patient consultations\n- Medical dictations\n- Clinical observations\n\n### Legal Documentation\n- Court proceedings\n- Client interviews\n- Legal consultations\n\n### General Purpose\n- Meeting minutes\n- Interviews\n- Personal notes\n\n## 🛠️ Customization Options\n\n### 1. Transcription Prompts\nCustomize how the initial transcription is processed:\n```python\nset_custom_prompts(new_transcription_prompt=\"Your custom prompt here\")\n```\n\n### 2. Refinement Templates\nControl how the transcription is refined:\n```python\ntemplate = \"\"\"\nRefine this {language} text: \"{text}\"\nInclude your refinement instructions here.\n\"\"\"\nset_custom_prompts(new_refinement_prompt_template=template)\n```\n\n### 3. Title Formatting\nCustomize the display title:\n```python\nset_custom_prompts(new_title_format=\"✨ Custom {language} Title\")\n```\n\n## 📝 Requirements\n\n- Python 3.7+\n- Microphone (for recording features)\n- Internet connection (for AI processing and API key verification)\n- WAV file support\n- Valid Dhvagna API key\n\n## 🔧 Technical Details\n\n- Uses Dhvagna for advanced language processing\n- Supports WAV audio format\n- Real-time audio processing\n- Automatic language detection\n- Multi-threaded recording handling\n- Smart error recovery and fallback options\n- Secure API key validation and usage tracking\n\n## 🌐 Links\n\n- GitHub: [https://github.com/gnanesh-16/Dhvagna](https://github.com/gnanesh-16/Dhvagna)\n- pypi: [https://pypi.org/project/dhvagna/#description](https://pypi.org/project/dhvagna/#description)\n- Author: Gnox79 {Gnanesh B}\n\n## 📄 License\n\nMIT License - See LICENSE file for details\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. See our [Contributing Guidelines](CONTRIBUTING.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnanesh-16%2Fdhvagna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnanesh-16%2Fdhvagna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnanesh-16%2Fdhvagna/lists"}