Name | bard-cli JSON |
Version |
0.9.2
JSON |
| download |
home_page | None |
Summary | bard is a text to speech tool based on existing open-source models (local install) and APIs to install on your desktop |
upload_time | 2025-02-23 14:08:07 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2024 Mahé Perrette
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Note: This project relies on external packages that may have more restrictive
licenses. Please review the
licenses of all dependencies before using or distributing this software to
ensure compliance with their respective terms. |
keywords |
text-to-speech
ai
language
openai
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[](https://pypi.org/project/bard-cli)

# Bard <img src="https://github.com/perrette/bard/raw/main/bard_data/share/icon.png" width=48px>
Bard is a text to speech client that integrates on the desktop
## Install
Install libraries or system-specific dependencies:
```bash
sudo apt-get install portaudio19-dev xclip # portaudio19-dev becomes portaudio with Homebrew
sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1 # Ubuntu ONLY (not needed on MacOS)
pip install PyGObject # Ubuntu ONLY (not needed on MacOS)
```
Install the main app with all its optional dependencies:
```bash
pip install bard-cli[all]
```
### GNOME
On GNOME desktop you can subsequently run:
```bash
bard-install [...] --openai-api-key $OPENAI_API_KEY
```
to produce a `.desktop` file for GNOME's quick-launch
(the `[...]` indicates any argument that `bard` takes)
## Usage
In a terminal:
```bash
bard
```
which defaults to:
```bash
bard --backend openaiapi --voice allow --model tts-1
```
(this assumes the environment variable `OPENAI_API_KEY` is defined)
An icon should show up almost immediately in the system tray, with options to copy the content of the clipboard (the last thing you copy-pasted)
and send that to the AI model for reading aloud.
<img src=https://github.com/user-attachments/assets/a90ccd1c-7431-4554-9d41-0e9c1b4399f2 width=300px>
You can also do a one-off reading by indicating the source content with one of the following:
```bash
bard --text "Hello world, how are you today"
bard --clipboard
bard --url "example.com" # also accepts file://
bard --html-file /path/to/downloaded.html # access a page with paywal, download it, feed it to bard
bard --pdf-file /path/to/document.pdf # careful if you pay for it... (the full thing will be transcribed even if you listen to a small bit of it)
bard --audio-file /path/to/audio.mp3 # no actual request, only useful for testing the audio player
```
The above command will still launch the system tray icon, and so provide access to the audio player's (basic) controls.
If you wish to just read aloud without the icon tray app, you may add the `--no-tray` parameter.
The clipboard parsing capabilities are elaborate enough so that it can detect an URL, a file path or common HTML markup.
If a file path is detected, the extension is checked for `.html`-ish and `.pdf`, and the data is extracted accordingly.
Here we make good use of the most useful work on [readability](https://pypi.org/project/readability-lxml).
In particular, this allows relatively easy reading out of webpages behind paywals, by right-clicking on "View Page Source"
or similar options, select all text, copy and just proceed with bards' "Process Copied Text" or `--clipboard` options.
For other articles not protected by a paywall, copying the URL should suffice.
You can resume the previous recording (the audio won't play right away in this case, but you can use the reader):
```bash
bard --resume
```
You can ask also ask the app to removed your (local) traces:
```bash
bard --clean-cache-on-exit
```
## Fine-tuning
```bash
bard --chunk-size 500 # that's the default
```
sets the maximum length (in characters) of a request. That means about 30 seconds of speech.
The program will split up the text in chunks (according to the punctuation) and download them sequentially.
The reading will start with the first chunk, that's why it is convenient to keep it small.
You can set that smaller or up to the maximum allowed by the openai API (4096).
## Player
The player was devised in conversation with Mistral's Le Chat and Open AI's Chat GPT, and my own experience with `pystray` on [scribe](https://github.com/perrette/scribe). It works.
I'm open for suggestion for other, platform-independent integrations to the OS.
## Roadmap
Include more backends including local ones.
Raw data
{
"_id": null,
"home_page": null,
"name": "bard-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "text-to-speech, AI, language, openai",
"author": null,
"author_email": "Mah\u00e9 Perrette <mahe.perrette@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e5/ce/1d6efae59c020a8f14c793335d2fe1d136816eb84481db9fed23dc820937/bard_cli-0.9.2.tar.gz",
"platform": null,
"description": "[](https://pypi.org/project/bard-cli)\n\n\n# Bard <img src=\"https://github.com/perrette/bard/raw/main/bard_data/share/icon.png\" width=48px>\n\nBard is a text to speech client that integrates on the desktop\n\n## Install\n\nInstall libraries or system-specific dependencies:\n\n```bash\nsudo apt-get install portaudio19-dev xclip # portaudio19-dev becomes portaudio with Homebrew\nsudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1 # Ubuntu ONLY (not needed on MacOS)\npip install PyGObject # Ubuntu ONLY (not needed on MacOS)\n```\n\nInstall the main app with all its optional dependencies:\n\n```bash\npip install bard-cli[all]\n```\n\n### GNOME\n\nOn GNOME desktop you can subsequently run:\n```bash\nbard-install [...] --openai-api-key $OPENAI_API_KEY\n```\nto produce a `.desktop` file for GNOME's quick-launch\n(the `[...]` indicates any argument that `bard` takes)\n\n## Usage\n\nIn a terminal:\n\n```bash\nbard\n```\nwhich defaults to:\n```bash\nbard --backend openaiapi --voice allow --model tts-1\n```\n(this assumes the environment variable `OPENAI_API_KEY` is defined)\n\nAn icon should show up almost immediately in the system tray, with options to copy the content of the clipboard (the last thing you copy-pasted)\nand send that to the AI model for reading aloud.\n\n<img src=https://github.com/user-attachments/assets/a90ccd1c-7431-4554-9d41-0e9c1b4399f2 width=300px>\n\nYou can also do a one-off reading by indicating the source content with one of the following:\n\n```bash\nbard --text \"Hello world, how are you today\"\nbard --clipboard\nbard --url \"example.com\" # also accepts file://\nbard --html-file /path/to/downloaded.html # access a page with paywal, download it, feed it to bard\nbard --pdf-file /path/to/document.pdf # careful if you pay for it... (the full thing will be transcribed even if you listen to a small bit of it)\nbard --audio-file /path/to/audio.mp3 # no actual request, only useful for testing the audio player\n```\nThe above command will still launch the system tray icon, and so provide access to the audio player's (basic) controls.\nIf you wish to just read aloud without the icon tray app, you may add the `--no-tray` parameter.\n\nThe clipboard parsing capabilities are elaborate enough so that it can detect an URL, a file path or common HTML markup.\nIf a file path is detected, the extension is checked for `.html`-ish and `.pdf`, and the data is extracted accordingly.\nHere we make good use of the most useful work on [readability](https://pypi.org/project/readability-lxml).\nIn particular, this allows relatively easy reading out of webpages behind paywals, by right-clicking on \"View Page Source\"\nor similar options, select all text, copy and just proceed with bards' \"Process Copied Text\" or `--clipboard` options.\nFor other articles not protected by a paywall, copying the URL should suffice.\n\nYou can resume the previous recording (the audio won't play right away in this case, but you can use the reader):\n```bash\nbard --resume\n```\nYou can ask also ask the app to removed your (local) traces:\n```bash\nbard --clean-cache-on-exit\n```\n\n## Fine-tuning\n\n```bash\nbard --chunk-size 500 # that's the default\n```\nsets the maximum length (in characters) of a request. That means about 30 seconds of speech.\nThe program will split up the text in chunks (according to the punctuation) and download them sequentially.\nThe reading will start with the first chunk, that's why it is convenient to keep it small.\nYou can set that smaller or up to the maximum allowed by the openai API (4096).\n\n## Player\n\nThe player was devised in conversation with Mistral's Le Chat and Open AI's Chat GPT, and my own experience with `pystray` on [scribe](https://github.com/perrette/scribe). It works.\n\nI'm open for suggestion for other, platform-independent integrations to the OS.\n\n\n## Roadmap\n\nInclude more backends including local ones.\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2024 Mah\u00e9 Perrette\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n \n ---\n \n Note: This project relies on external packages that may have more restrictive\n licenses. Please review the\n licenses of all dependencies before using or distributing this software to\n ensure compliance with their respective terms.",
"summary": "bard is a text to speech tool based on existing open-source models (local install) and APIs to install on your desktop",
"version": "0.9.2",
"project_urls": {
"Homepage": "https://github.com/perrette/bard"
},
"split_keywords": [
"text-to-speech",
" ai",
" language",
" openai"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "fbab4b24dbad7bf571ebd5553f9916e9e18da67c96ac094bb2e308917d69b693",
"md5": "d3e56c73d2e272f9d3333b1608d24f63",
"sha256": "aa3dfc37ef8907ccf712a2aeab5bd6de8a41f8eec38caab53b468ad797a6c48c"
},
"downloads": -1,
"filename": "bard_cli-0.9.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d3e56c73d2e272f9d3333b1608d24f63",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 20388,
"upload_time": "2025-02-23T14:08:04",
"upload_time_iso_8601": "2025-02-23T14:08:04.731153Z",
"url": "https://files.pythonhosted.org/packages/fb/ab/4b24dbad7bf571ebd5553f9916e9e18da67c96ac094bb2e308917d69b693/bard_cli-0.9.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e5ce1d6efae59c020a8f14c793335d2fe1d136816eb84481db9fed23dc820937",
"md5": "152ee6939f3893e82fa8209c0b5937ad",
"sha256": "b1d387a5e6fc12f77722487cca6f858bafcf92bb31ddd9ed0a12ffe37f94f640"
},
"downloads": -1,
"filename": "bard_cli-0.9.2.tar.gz",
"has_sig": false,
"md5_digest": "152ee6939f3893e82fa8209c0b5937ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 21938,
"upload_time": "2025-02-23T14:08:07",
"upload_time_iso_8601": "2025-02-23T14:08:07.733567Z",
"url": "https://files.pythonhosted.org/packages/e5/ce/1d6efae59c020a8f14c793335d2fe1d136816eb84481db9fed23dc820937/bard_cli-0.9.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-23 14:08:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "perrette",
"github_project": "bard",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bard-cli"
}