aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2019-04-07 18:05:35 +0000
committerMike Crute <mike@crute.us>2019-04-07 18:05:35 +0000
commit179d8d9f24af843913b3cb87cae2252d43a06be9 (patch)
tree6488bafbe46234ef6fc88cd68c79085de506472e
parentf304b4ce0d654c224cf9b8bad379e630d740a9b9 (diff)
downloadpydora-179d8d9f24af843913b3cb87cae2252d43a06be9.tar.bz2
pydora-179d8d9f24af843913b3cb87cae2252d43a06be9.tar.xz
pydora-179d8d9f24af843913b3cb87cae2252d43a06be9.zip
Rearrange/cleanup README
-rw-r--r--README.rst106
1 files changed, 60 insertions, 46 deletions
diff --git a/README.rst b/README.rst
index 5522ecf..b9e6767 100644
--- a/README.rst
+++ b/README.rst
@@ -22,54 +22,19 @@ Keys or passwords for Pandora are **not** provided in this repo, you'll have to
22for yourself. Make something awesome with this library, don't abuse Pandora, 22for yourself. Make something awesome with this library, don't abuse Pandora,
23that's not cool. 23that's not cool.
24 24
25Compatability
26=============
25This is the ``2.x`` series which supports only Python 3.5+. For older versions 27This is the ``2.x`` series which supports only Python 3.5+. For older versions
26of Python please use the |1.x|_ series. The |1.x|_ series is no longer 28of Python please use the |1.x|_ series. The |1.x|_ series is no longer
27maintained but pull requests to fix bugs are still welcomed. 29maintained but pull requests to fix bugs are still welcomed.
28 30
29Programmatic Use 31This package uses semantic versioning. The API is guaranteed to be stable
30================ 32within a major version release. Please constrain your dependencies to major
31The pydora distribution contains two python packages. The ``pandora`` package 33versions. For example, to depend on version ``2.x`` use this line in your
32is the API for interacting with the Pandora service. The ``pydora`` package is 34setup.py ``install_requires``::
33a very small reference implementation of using the API to drive a command line
34player. If you're interested in the command line skip this section and read
35Installing below to get started.
36
37**NOTE:** This package uses semantic versioning. The API is stable within a
38major version release. Please constrain your dependencies to major versions.
39For example, to depend on version ``2.x`` use this line in your setup.py
40``install_requires``::
41 35
42 pydora>=2,<3 36 pydora>=2,<3
43 37
44The easiest way to get started is by using the |pandora.clientbuilder|_
45package. This package contains a set of factories that can be used to build a
46Pandora client with some configuration. The classes in the package that end in
47``Builder`` are the factories and the rest of the classes are implementation
48details. All of the builders will return an instance of
49|pandora.client.APIClient|_ that is completely configured and ready for use in
50your program.
51
52If you have an existing program and would like to connect to Pandora the
53easiest way is to use the |SettingsDictBuilder|_ class like so::
54
55 client = SettingsDictBuilder({
56 "DECRYPTION_KEY": "see_link_above",
57 "ENCRYPTION_KEY": "see_link_above",
58 "PARTNER_USER": "see_link_above",
59 "PARTNER_PASSWORD": "see_link_above",
60 "DEVICE": "see_link_above",
61 }).build()
62
63 client.login("username", "password")
64
65At this point the client is ready for use, see |pandora.client.APIClient|_ for
66a list of methods that can be called. All responses from the API will return
67Python objects from the |pandora.models.pandora|_ package or raise exceptions
68from |pandora.errors|_
69
70For a more functional example look at the file |pydora/player.py|_ which shows
71how to use the API in a simple command line application.
72
73Installing 38Installing
74========== 39==========
75Installing is as simple as using pip and running the built-in configuration 40Installing is as simple as using pip and running the built-in configuration
@@ -153,10 +118,14 @@ When playing the following keys work (press enter afterwards):
153* ``vd`` - volume down 118* ``vd`` - volume down
154* ``?`` - display help 119* ``?`` - display help
155 120
156Note that volume control is currently only supported with the VLC back-end. 121**Note**: volume control is currently only supported with the VLC back-end.
157 122
158Sample Config File 123Sample Config File
159================== 124==================
125The built-in ``pydora-configure`` script can be run to create a configuration
126file automatically if you don't already have one. This will download the keys
127from the link below and pick a suitable one when writing the config file. If
128you want to create the config file manually the format is:
160:: 129::
161 130
162 [api] 131 [api]
@@ -178,12 +147,48 @@ Sample Config File
178 is not available for the device specified, then the next-highest bit-rate 147 is not available for the device specified, then the next-highest bit-rate
179 stream that Pandora supports for the chosen device will be used. 148 stream that Pandora supports for the chosen device will be used.
180 149
150Programmatic Use
151================
152The Pydora distribution contains two python packages. The |pandora package|_
153is the API for interacting with the Pandora service. The |pydora package|_ is
154a very small reference implementation of using the API to drive a command line
155player. If you're interested in the command line skip this section and read
156Installing below to get started.
157
158The easiest way to get started is by using the |pandora.clientbuilder|_
159package. This package contains a set of factories that can be used to build a
160Pandora client with some configuration. The classes in the package that end in
161``Builder`` are the factories and the rest of the classes are implementation
162details. All of the builders will return an instance of
163|pandora.client.APIClient|_ that is completely configured and ready for use in
164your program.
165
166If you have an existing program and would like to connect to Pandora the
167easiest way is to use the |SettingsDictBuilder|_ class like so::
168
169 client = SettingsDictBuilder({
170 "DECRYPTION_KEY": "see_link_above",
171 "ENCRYPTION_KEY": "see_link_above",
172 "PARTNER_USER": "see_link_above",
173 "PARTNER_PASSWORD": "see_link_above",
174 "DEVICE": "see_link_above",
175 }).build()
176
177 client.login("username", "password")
178
179At this point the client is ready for use, see |pandora.client.APIClient|_ for
180a list of methods that can be called. All responses from the API will return
181Python objects from the |pandora.models.pandora|_ package or raise exceptions
182from |pandora.errors|_
183
184For a more functional example look at the file |pydora/player.py|_ which shows
185how to use the API in a simple command line application.
186
181Pandora API Spec and Partner Keys 187Pandora API Spec and Partner Keys
182================================= 188=================================
183The built-in ``pydora-configure`` script can be run to create a configuration 189If you're interested in the underlying API or need to download the keys
184file if you don't already have one. This will download the keys from the link 190yourself you can find more details at the links below. This documentation is
185below and pick a suitable one. If you're interested in the underlying API or 191community maintained and not official.
186need to download the keys yourself you can find them at the link below.
187 192
188* `API Spec <http://6xq.net/playground/pandora-apidoc/>`_ 193* `API Spec <http://6xq.net/playground/pandora-apidoc/>`_
189* `Partner Keys <http://6xq.net/playground/pandora-apidoc/json/partners/#partners>`_ 194* `Partner Keys <http://6xq.net/playground/pandora-apidoc/json/partners/#partners>`_
@@ -194,6 +199,9 @@ See `CONTRIBUTING <https://github.com/mcrute/pydora/blob/master/CONTRIBUTING.rst
194 199
195Contributors 200Contributors
196============ 201============
202Thanks to the contributors who make Pydora possible by adding features and
203fixing bugs. List is organized by date of first contribution.
204
197* Mike Crute (`@mcrute <https://github.com/mcrute>`_) 205* Mike Crute (`@mcrute <https://github.com/mcrute>`_)
198* John Cass (`@jcass77 <https://github.com/jcass77>`_) 206* John Cass (`@jcass77 <https://github.com/jcass77>`_)
199* Thomas Weißschuh (`@t-8c <https://github.com/t-8ch>`_) 207* Thomas Weißschuh (`@t-8c <https://github.com/t-8ch>`_)
@@ -203,6 +211,12 @@ Contributors
203.. |1.x| replace:: ``1.x`` 211.. |1.x| replace:: ``1.x``
204.. _1.x: https://github.com/mcrute/pydora/tree/1.x 212.. _1.x: https://github.com/mcrute/pydora/tree/1.x
205 213
214.. |pandora package| replace:: ``pandora`` package
215.. _pandora package: https://github.com/mcrute/pydora/tree/master/pandora
216
217.. |pydora package| replace:: ``pydora`` package
218.. _pydora package: https://github.com/mcrute/pydora/tree/master/pydora
219
206.. |pandora.clientbuilder| replace:: ``pandora.clientbuilder`` 220.. |pandora.clientbuilder| replace:: ``pandora.clientbuilder``
207.. _pandora.clientbuilder: https://github.com/mcrute/pydora/blob/master/pandora/clientbuilder.py 221.. _pandora.clientbuilder: https://github.com/mcrute/pydora/blob/master/pandora/clientbuilder.py
208 222