An MPD (Music Player Daemon) client library written in pure Python.
Project description
Getting python-musicpd
The latest release of python-musicpd can be found at http://pypi.python.org/pypi/python-musicpd.
Getting the latest source code
If you would instead like to use the latest source code, you can grab a copy of the development version from git by running the command:
git clone git://git.kaliko.me/python-musicpd.git
Installing from source
To install python-musicpd from source, simply run the command:
python3 setup.py install
You can use the –help switch to setup.py for a complete list of commands and their options. See the Installing Python Modules document for more details.
Using the client library
The client library can be used as follows:
client = musicpd.MPDClient() # create client object client.connect('localhost', 6600) # connect to localhost:6600 print client.mpd_version # print the mpd version print client.cmd('one', 2) # print result of the command "cmd one 2" client.close() # send the close command client.disconnect() # disconnect from the server
A list of supported commands, their arguments (as MPD currently understands them), and the functions used to parse their responses can be found in doc/commands.txt. See the MPD protocol documentation for more details.
Command lists are also supported using command_list_ok_begin() and command_list_end()
client.command_list_ok_begin() # start a command list client.update() # insert the update command into the list client.status() # insert the status command into the list results = client.command_list_end() # results will be a list with the results
Commands may also return iterators instead of lists if iterate is set to True:
client.iterate = True for song in client.playlistinfo(): print song['file']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
File details
Details for the file python-musicpd-0.4.0.zip
.
File metadata
- Download URL: python-musicpd-0.4.0.zip
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65403ed576e2964d0e3a3f881c413868b09b0ab97a93decfa0410a7c689244eb |
|
MD5 | ebef2a889f2e968f2f0929e12e3f3c44 |
|
BLAKE2b-256 | 9da7b91023d324f1a4de465f189957de7327f2d0e296405f29b2e056ce260882 |
File details
Details for the file python-musicpd-0.4.0.tar.gz
.
File metadata
- Download URL: python-musicpd-0.4.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f89f956487c8fff837a35f1d331f02cb9d660bab51eaf8b6a69f15442e2672b |
|
MD5 | 4f1a85ab32d51b0a18d90d68a0638da6 |
|
BLAKE2b-256 | 5f4cafd52a760dc4f619e53bca9a023a25c63f7ded07c8d8591e6be92348762a |
File details
Details for the file python-musicpd-0.4.0.tar.bz2
.
File metadata
- Download URL: python-musicpd-0.4.0.tar.bz2
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3846b8b233ce1a672e2a34cd43628d4fe8e9932b6444b83e68a7cedfb3d8d0d6 |
|
MD5 | 1bedd72a7c508258895b9e1373688f69 |
|
BLAKE2b-256 | 5082404b84349c4e61600148980dc0435ff99382ad8b9294a7140d2c6d96313a |