Name | DFPlayer JSON |
Version |
0.1.2
JSON |
| download |
home_page | https://github.com/dianudi/dfplayer-py |
Summary | Python3 library for the DFPlayer-mini |
upload_time | 2024-05-19 14:40:34 |
maintainer | None |
docs_url | None |
author | Dianudi |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024 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. |
keywords |
dfplayer
dfplayer-mini
mp3-module
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# DFPlayer
Python3 library for the DFPlayer Mini MP3 Module, works with USB to TTL.
![Main interface](/assets/wiring_diagram.webp?raw=true)
## Installation
```bash
pip install DFPlayer
```
## Usage
```python
from DFPlayer import DFPlayer
serial_device = '/dev/ttyUSB0' # on Windows OS use COMX, example 'COM5'
df = DFPlayer(serial_device)
df.num_files() # get number of files on the SD card
df.play(1) # play a song by a specific number of files, without argument play the first song
df.random() # play random song
df.next() # play next song
df.previous() # play previous song
df.pause() # pause played song
df.stop() # stop played song
df.loop() # loop current played song
df.loop_all() # loop all songs on the SD card
df.set_volume(60) # set volume to 60%, default is 50
df.get_volume() # get current audio volume
df.set_eq(DFPlayer.EQ_NORMAL) # set equalizer to (EQ_NORMAL, EQ_POP, EQ_ROCK, EQ_JAZZ, EQ_CLASSIC, EQ_BASS), default is EQ_NORMAL
df.get_eq() # get current equalizer
df.reset() # reset the module
```
## Test
Make sure the module has an SD card installed and has a minimum of three songs inside. Connect with USB to TTL.
```bash
pip install -r requirements.txt
python3 -m unittest
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dianudi/dfplayer-py",
"name": "DFPlayer",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "dfplayer, dfplayer-mini, mp3-module",
"author": "Dianudi",
"author_email": "dianudi <dian_udi@proton.me>",
"download_url": "https://files.pythonhosted.org/packages/44/0d/0d3d5b6bf4d979bef14a33db249da09471aeadfa6e1a027147f303be041b/dfplayer-0.1.2.tar.gz",
"platform": null,
"description": "# DFPlayer\n\nPython3 library for the DFPlayer Mini MP3 Module, works with USB to TTL.\n\n![Main interface](/assets/wiring_diagram.webp?raw=true)\n\n## Installation\n\n```bash\npip install DFPlayer\n```\n\n## Usage\n\n```python\nfrom DFPlayer import DFPlayer\n\nserial_device = '/dev/ttyUSB0' # on Windows OS use COMX, example 'COM5'\ndf = DFPlayer(serial_device)\n\ndf.num_files() # get number of files on the SD card\ndf.play(1) # play a song by a specific number of files, without argument play the first song\ndf.random() # play random song\ndf.next() # play next song\ndf.previous() # play previous song\ndf.pause() # pause played song\ndf.stop() # stop played song\ndf.loop() # loop current played song\ndf.loop_all() # loop all songs on the SD card\ndf.set_volume(60) # set volume to 60%, default is 50\ndf.get_volume() # get current audio volume\ndf.set_eq(DFPlayer.EQ_NORMAL) # set equalizer to (EQ_NORMAL, EQ_POP, EQ_ROCK, EQ_JAZZ, EQ_CLASSIC, EQ_BASS), default is EQ_NORMAL\ndf.get_eq() # get current equalizer\ndf.reset() # reset the module\n```\n\n## Test\n\nMake sure the module has an SD card installed and has a minimum of three songs inside. Connect with USB to TTL.\n\n```bash\npip install -r requirements.txt\npython3 -m unittest\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 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. ",
"summary": "Python3 library for the DFPlayer-mini",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/dianudi/dfplayer-py",
"Issues": "https://github.com/dianudi/dfplayer-py/issues"
},
"split_keywords": [
"dfplayer",
" dfplayer-mini",
" mp3-module"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "90ba8ae70304d0334e24e4ffb96625cd47630c9ad785d9384438bd37b8e75792",
"md5": "d88f068fde4236191f7722cc58dd3e34",
"sha256": "fa17f5a4be4ebd57788a395d2f893f570277a3652277146ea670e3b7b0dcdc1d"
},
"downloads": -1,
"filename": "DFPlayer-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d88f068fde4236191f7722cc58dd3e34",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5360,
"upload_time": "2024-05-19T14:40:27",
"upload_time_iso_8601": "2024-05-19T14:40:27.055350Z",
"url": "https://files.pythonhosted.org/packages/90/ba/8ae70304d0334e24e4ffb96625cd47630c9ad785d9384438bd37b8e75792/DFPlayer-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "440d0d3d5b6bf4d979bef14a33db249da09471aeadfa6e1a027147f303be041b",
"md5": "8fff322ed2ca457f2318c4c8b6d9d6f6",
"sha256": "03991c1f4941afdc8ec08bbe9dad8db382ae6a30e772c99290faf4b4db60cc7c"
},
"downloads": -1,
"filename": "dfplayer-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "8fff322ed2ca457f2318c4c8b6d9d6f6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5173,
"upload_time": "2024-05-19T14:40:34",
"upload_time_iso_8601": "2024-05-19T14:40:34.137153Z",
"url": "https://files.pythonhosted.org/packages/44/0d/0d3d5b6bf4d979bef14a33db249da09471aeadfa6e1a027147f303be041b/dfplayer-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-19 14:40:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dianudi",
"github_project": "dfplayer-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "dfplayer"
}