]> kaliko git repositories - python-musicpd.git/blob - README.rst
Fixed documentation
[python-musicpd.git] / README.rst
1 ==============
2 python-musicpd
3 ==============
4
5 Getting python-musicpd
6 ----------------------
7
8 The latest release of python-musicpd can be found at
9 http://pypi.python.org/pypi/python-musicpd.
10
11
12 Getting the latest source code
13 ------------------------------
14
15 If you would instead like to use the latest source code, you can grab a copy
16 of the development version from git by running the command:
17
18   git clone git://git.kaliko.me/python-musicpd.git
19
20
21 Installing from source
22 ----------------------
23
24 To install python-musicpd from source, simply run the command::
25
26   python3 setup.py install
27
28 You can use the `--help` switch to `setup.py` for a complete list of commands
29 and their options.  See the `Installing Python Modules`_ document for more details.
30
31
32 Using the client library
33 ------------------------
34
35 The client library can be used as follows::
36
37     client = musicpd.MPDClient()       # create client object
38     client.connect('localhost', 6600)  # connect to localhost:6600
39     print client.mpd_version           # print the mpd version
40     print client.cmd('one', 2)         # print result of the command "cmd one 2"
41     client.close()                     # send the close command
42     client.disconnect()                # disconnect from the server
43
44 A list of supported commands, their arguments (as MPD currently understands
45 them), and the functions used to parse their responses can be found in
46 `doc/commands.txt`.  See the `MPD protocol documentation`_ for more
47 details.
48
49 Command lists are also supported using `command_list_ok_begin()` and
50 `command_list_end()` ::
51
52     client.command_list_ok_begin()       # start a command list
53     client.update()                      # insert the update command into the list
54     client.status()                      # insert the status command into the list
55     results = client.command_list_end()  # results will be a list with the results
56
57
58 Commands may also return iterators instead of lists if `iterate` is set to
59 `True`::
60
61     client.iterate = True
62     for song in client.playlistinfo():
63         print song['file']
64
65
66 Contacting authors
67 ------------------
68
69 You can contact the original author by emailing J. Alexander Treuman
70 <jat⊘spatialrift.net>.  He can also be found idling in #mpd on
71 irc.freenode.net as jat.
72
73 The current maintainer can be found on xmpp chat room <kaliko.me⊘conf.azylum.org>
74 or you can contact him by email/xmpp <kaliko⊘azylum.org>.
75
76  .. _Installing Python Modules: http://docs.python.org/3/install/
77  .. _MPD protocol documentation: http://www.musicpd.org/doc/protocol/