# audio-plot-lib
![Python package](https://github.com/hassaku/audio-plot-lib/workflows/Python%20package/badge.svg)
This library provides graph sonification functions
and has been developed for a project named "Data science and machine learning resources for screen reader users".
Please refer to the project page for more details.
https://hassaku.github.io/DS-and-ML-with-screen-reader/
# Use in Google Colab (recommended)
Try the following example.
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/hassaku/audio-plot-lib/blob/master/audio_plot_lib_example.ipynb)
# Use in script (option)
## Interactive
Generate html with graphs that can be displayed interactively in a browser.
### Dependency
```
$ pip install audio-plot-lib
$ pip install beautifulsoup4
```
### Example
```
import audio_plot_lib as apl
# apl.interactive.set_language("ja") # Option to change language. Default is "en"
apl.interactive.plot([0, 1, 2, 3, 2, 1, 0], script_name=__file__)
```
Open the html file with the same name as the script name in your browser, and if you find a button that reads 'push here to unmute graph', try moving the mouse cursor appropriately after pressing the button. If not, try reloading the page.
## Playable
Generate an audio file with sonified graphs.
### Dependency
```
$ sudo apt-get install libavformat-dev libavfilter-dev libavdevice-dev ffmpeg
$ pip install audio-plot-lib
```
### Example
```
import audio_plot_lib as apl
from pydub.playback import play
# generate graph sound
audio = apl.playable.plot([0, 1, 2, 3, 2, 1, 0], duration=300, autoplay=False)
# play
play(audio)
# save to audio file
audio.export("graph.wav", format="wav")
```
# For contributer
## Update PyPI
```
$ python -m unittest discover tests
$ pip install twine # if necessary
$ cat ~/.pypirc # if necessary
[distutils]
index-servers = pypi
[pypi]
repository: https://upload.pypi.org/legacy/
username: YOUR_USERNAME
password: YOUR_PASSWORD
$ rm -rf audio-plot-lib.egg-info dist # if necessary
$ python setup.py sdist
$ twine upload --repository pypi dist/*
$ pip --no-cache-dir install --upgrade audio-plot-lib
```
https://pypi.org/project/audio-plot-lib/
## Contributing
- Fork the repository on Github
- Create a named feature branch (like add_component_x)
- Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
# License
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/hassaku/audio-plot-lib",
"name": "audio-plot-lib",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "audio plot visually-impaired",
"author": "hassaku",
"author_email": "hassaku.apps@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b1/34/fd096657bd35dcf13a27daeb40367253e9ae9e632e37ac6eb883bd3b153a/audio-plot-lib-0.1.2.tar.gz",
"platform": null,
"description": "# audio-plot-lib\n\n![Python package](https://github.com/hassaku/audio-plot-lib/workflows/Python%20package/badge.svg)\n\nThis library provides graph sonification functions\n and has been developed for a project named \"Data science and machine learning resources for screen reader users\".\n Please refer to the project page for more details.\n\nhttps://hassaku.github.io/DS-and-ML-with-screen-reader/\n\n# Use in Google Colab (recommended)\n\nTry the following example.\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/hassaku/audio-plot-lib/blob/master/audio_plot_lib_example.ipynb)\n\n# Use in script (option)\n\n## Interactive\n\nGenerate html with graphs that can be displayed interactively in a browser.\n\n### Dependency\n\n```\n$ pip install audio-plot-lib\n$ pip install beautifulsoup4\n```\n\n### Example\n\n```\nimport audio_plot_lib as apl\n# apl.interactive.set_language(\"ja\") # Option to change language. Default is \"en\"\napl.interactive.plot([0, 1, 2, 3, 2, 1, 0], script_name=__file__)\n```\n\nOpen the html file with the same name as the script name in your browser, and if you find a button that reads 'push here to unmute graph', try moving the mouse cursor appropriately after pressing the button. If not, try reloading the page.\n\n## Playable\n\nGenerate an audio file with sonified graphs.\n\n### Dependency\n\n```\n$ sudo apt-get install libavformat-dev libavfilter-dev libavdevice-dev ffmpeg\n$ pip install audio-plot-lib\n```\n\n### Example\n\n```\nimport audio_plot_lib as apl\nfrom pydub.playback import play\n\n# generate graph sound\naudio = apl.playable.plot([0, 1, 2, 3, 2, 1, 0], duration=300, autoplay=False)\n\n# play\nplay(audio)\n\n# save to audio file\naudio.export(\"graph.wav\", format=\"wav\")\n```\n\n# For contributer\n\n## Update PyPI\n\n```\n$ python -m unittest discover tests\n$ pip install twine # if necessary\n$ cat ~/.pypirc # if necessary\n[distutils]\nindex-servers = pypi\n\n[pypi]\nrepository: https://upload.pypi.org/legacy/\nusername: YOUR_USERNAME\npassword: YOUR_PASSWORD\n$ rm -rf audio-plot-lib.egg-info dist # if necessary\n$ python setup.py sdist\n$ twine upload --repository pypi dist/*\n$ pip --no-cache-dir install --upgrade audio-plot-lib\n```\n\nhttps://pypi.org/project/audio-plot-lib/\n\n## Contributing\n\n- Fork the repository on Github\n- Create a named feature branch (like add_component_x)\n- Write your change\n- Write tests for your change (if applicable)\n- Run the tests, ensuring they all pass\n- Submit a Pull Request using Github\n\n# License\n\nMIT\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Plot tools based on audio",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/hassaku/audio-plot-lib"
},
"split_keywords": [
"audio",
"plot",
"visually-impaired"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b134fd096657bd35dcf13a27daeb40367253e9ae9e632e37ac6eb883bd3b153a",
"md5": "40e5022c9728f00859444088c9c23c84",
"sha256": "0cafbfcda78fa1662d4e9548b9f1fbae189c971d78600054af079532157811e6"
},
"downloads": -1,
"filename": "audio-plot-lib-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "40e5022c9728f00859444088c9c23c84",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10260,
"upload_time": "2023-10-15T14:18:28",
"upload_time_iso_8601": "2023-10-15T14:18:28.414087Z",
"url": "https://files.pythonhosted.org/packages/b1/34/fd096657bd35dcf13a27daeb40367253e9ae9e632e37ac6eb883bd3b153a/audio-plot-lib-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-15 14:18:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hassaku",
"github_project": "audio-plot-lib",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "audio-plot-lib"
}