7 The latest release of python-mpd can be found at
8 http://pypi.python.org/pypi/python-mpd/[].
11 Getting the latest source code
12 ------------------------------
14 If you would instead like to use the latest source code, you can grab a copy
15 of the development version from git by running the command:
17 git clone git://jatreuman.indefero.net/jatreuman/python-mpd.git
20 Installing from source
21 ----------------------
23 To install python-mpd from source, simply run the command:
25 python setup.py install
27 You can use the `--help` switch to `setup.py` for a complete list of commands
28 and their options. See the http://docs.python.org/inst/inst.html[Installing
29 Python Modules] document for more details.
32 Using the client library
33 ------------------------
35 The client library can be used as follows:
37 ------------------------------------------------------------------------------
38 client = mpd.MPDClient() # create client object
39 client.connect("localhost", 6600) # connect to localhost:6600
40 print client.mpd_version # print the mpd version
41 print client.cmd("one", 2) # print result of the command "cmd one 2"
42 client.close() # send the close command
43 client.disconnect() # disconnect from the server
44 ------------------------------------------------------------------------------
46 A list of supported commands, their arguments (as MPD currently understands
47 them), and the functions used to parse their responses can be found in
48 `doc/commands.txt`. See the
49 http://www.musicpd.org/doc/protocol/[MPD protocol documentation] for more
52 Command lists are also supported using `command_list_ok_begin()` and
55 ------------------------------------------------------------------------------
56 client.command_list_ok_begin() # start a command list
57 client.update() # insert the update command into the list
58 client.status() # insert the status command into the list
59 results = client.command_list_end() # results will be a list with the results
60 ------------------------------------------------------------------------------
62 Commands may also return iterators instead of lists if `iterate` is set to
65 ------------------------------------------------------------------------------
67 for song in client.playlistinfo():
69 ------------------------------------------------------------------------------
75 You can contact the author by emailing J. Alexander Treuman
76 <mailto:jat@spatialrift.net[]>. He can also be found idling in #mpd on
77 irc.freenode.net as jat.