Skip to main content

Robot Framework library for audio transcription using faster-whisper.

Project description

Robot Framework WhisperLibrary

WhisperLibrary is a Robot Framework test library for transcribing audio files using faster-whisper, a fast and accurate implementation of OpenAI's Whisper model.

It enables easy integration of speech recognition into your automated Robot Framework tests with just a few intuitive keywords.


📦 Installation

Install WhisperLibrary directly from PyPI:

pip install robotframework-whisperlibrary

This will install WhisperLibrary along with all dependencies specified in requirements.txt.

To upgrade to the latest version:

pip install --upgrade robotframework-whisperlibrary

⚠️ If you plan to use a device other than CPU (e.g. GPU/CUDA), additional dependencies such as ctranslate2 and torch may be required. Refer to the faster-whisper requirements for more information.

✅ Usage Example

Create a Robot Framework test file like this:

*** Settings ***
Library    WhisperLibrary

*** Test Cases ***
Test With Hu Sound
    Initialize Whisper Model    base
    Transcribe File    ${EXECDIR}${/}sound${/}red_button_hu.wav
    ${text}=    Get Transcription Text
    Log To Console    Transcripted text: ${text}
    ${info}=    Get Transcription Info
    Should Be Equal As Strings    ${info['language']}    hu

Test With En Sound
    Initialize Whisper Model    base
    Set Transcription Language    en
    Transcribe File    ${EXECDIR}${/}sound${/}red_button_en.wav
    ${text}=    Get Transcription Text
    ${info}=    Get Transcription Info
    Should Be Equal As Strings    ${text}    In that case, press the red button and rest in peace.

Transcribe Nonexistent File Fails
    Initialize Whisper Model    base
    Run Keyword And Expect Error    *No such file or directory*    Transcribe File    not_a_real_file.wav

Get Text Without Transcription Fails
    Initialize Whisper Model    base
    Run Keyword And Expect Error    *No transcription available*    Get Transcription Text

🧪 Running Tests

From the project root, run tests located in the tests/ folder:

cd tests
python -m robot whisperlib_demo.robot

📁 Project Structure

project-root/
├── setup.py
├── requirements.txt
├── src/
│   └── WhisperLibrary/
│       ├── __init__.py
│       ├── __version__.py
│       └── keywords.py
└── tests/
    ├── sound/
    │   ├── red_button_hu.wav
    │   └── red_button_en.wav
    └── whisperlib_demo.robot

🤝 Contributing

This is my first open-source Python project, created as part of my learning journey into Python development and Robot Framework library creation — with the support of ChatGPT.

I'm happy to receive feedback, bug reports, and ideas for improvement!

Want to contribute?

  • Feel free to fork the project and submit a pull request.
  • Open an issue if you have suggestions or encounter a problem.
  • You can reach me via GitHub or by opening a discussion in this repository.

📬 Author

József Róka GitHub: @rokajozsef

📦 Repository

You can find the source code and contribute here: https://github.com/rokajozsef/robotframework-whisperlibrary

❤️ Acknowledgements

This library was built from scratch as a personal learning project with the help of ChatGPT, and inspired by the excellent work behind faster-whisper and the Robot Framework ecosystem.

🛡 License

This project is licensed under the MIT License – see the LICENSE file for details.

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

robotframework_whisperlibrary-0.1.4.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file robotframework_whisperlibrary-0.1.4.tar.gz.

File metadata

File hashes

Hashes for robotframework_whisperlibrary-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6b09227cd8daa33680b0a23471b9c1283d3947de2a6aaaee4f92454a74cc79cf
MD5 159e6209680455acd24369e679bb27d9
BLAKE2b-256 4ffe4ec94093c125bd1e246728b7d7163574d7ce57b432c49c194dca966f5122

See more details on using hashes here.

File details

Details for the file robotframework_whisperlibrary-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_whisperlibrary-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dba9f374d74bbe2b930f69c5ca26a05dabd7a0e052db8c6d724334a296990661
MD5 e110be50111ca3a5f2557120ddf3f9c9
BLAKE2b-256 f786f05b19fe9e21efa5c9953f007533160f0cf244181426cda7a901d38166d7

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