diff options
author | Mike Crute <mike@crute.us> | 2019-04-07 18:05:35 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2019-04-07 18:05:35 +0000 |
commit | 179d8d9f24af843913b3cb87cae2252d43a06be9 (patch) | |
tree | 6488bafbe46234ef6fc88cd68c79085de506472e | |
parent | f304b4ce0d654c224cf9b8bad379e630d740a9b9 (diff) | |
download | pydora-179d8d9f24af843913b3cb87cae2252d43a06be9.tar.bz2 pydora-179d8d9f24af843913b3cb87cae2252d43a06be9.tar.xz pydora-179d8d9f24af843913b3cb87cae2252d43a06be9.zip |
Rearrange/cleanup README
-rw-r--r-- | README.rst | 106 |
1 files changed, 60 insertions, 46 deletions
@@ -22,54 +22,19 @@ Keys or passwords for Pandora are **not** provided in this repo, you'll have to | |||
22 | for yourself. Make something awesome with this library, don't abuse Pandora, | 22 | for yourself. Make something awesome with this library, don't abuse Pandora, |
23 | that's not cool. | 23 | that's not cool. |
24 | 24 | ||
25 | Compatability | ||
26 | ============= | ||
25 | This is the ``2.x`` series which supports only Python 3.5+. For older versions | 27 | This is the ``2.x`` series which supports only Python 3.5+. For older versions |
26 | of Python please use the |1.x|_ series. The |1.x|_ series is no longer | 28 | of Python please use the |1.x|_ series. The |1.x|_ series is no longer |
27 | maintained but pull requests to fix bugs are still welcomed. | 29 | maintained but pull requests to fix bugs are still welcomed. |
28 | 30 | ||
29 | Programmatic Use | 31 | This package uses semantic versioning. The API is guaranteed to be stable |
30 | ================ | 32 | within a major version release. Please constrain your dependencies to major |
31 | The pydora distribution contains two python packages. The ``pandora`` package | 33 | versions. For example, to depend on version ``2.x`` use this line in your |
32 | is the API for interacting with the Pandora service. The ``pydora`` package is | 34 | setup.py ``install_requires``:: |
33 | a very small reference implementation of using the API to drive a command line | ||
34 | player. If you're interested in the command line skip this section and read | ||
35 | Installing below to get started. | ||
36 | |||
37 | **NOTE:** This package uses semantic versioning. The API is stable within a | ||
38 | major version release. Please constrain your dependencies to major versions. | ||
39 | For 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 | ||
44 | The easiest way to get started is by using the |pandora.clientbuilder|_ | ||
45 | package. This package contains a set of factories that can be used to build a | ||
46 | Pandora 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 | ||
48 | details. All of the builders will return an instance of | ||
49 | |pandora.client.APIClient|_ that is completely configured and ready for use in | ||
50 | your program. | ||
51 | |||
52 | If you have an existing program and would like to connect to Pandora the | ||
53 | easiest 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 | |||
65 | At this point the client is ready for use, see |pandora.client.APIClient|_ for | ||
66 | a list of methods that can be called. All responses from the API will return | ||
67 | Python objects from the |pandora.models.pandora|_ package or raise exceptions | ||
68 | from |pandora.errors|_ | ||
69 | |||
70 | For a more functional example look at the file |pydora/player.py|_ which shows | ||
71 | how to use the API in a simple command line application. | ||
72 | |||
73 | Installing | 38 | Installing |
74 | ========== | 39 | ========== |
75 | Installing is as simple as using pip and running the built-in configuration | 40 | Installing 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 | ||
156 | Note 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 | ||
158 | Sample Config File | 123 | Sample Config File |
159 | ================== | 124 | ================== |
125 | The built-in ``pydora-configure`` script can be run to create a configuration | ||
126 | file automatically if you don't already have one. This will download the keys | ||
127 | from the link below and pick a suitable one when writing the config file. If | ||
128 | you 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 | ||
150 | Programmatic Use | ||
151 | ================ | ||
152 | The Pydora distribution contains two python packages. The |pandora package|_ | ||
153 | is the API for interacting with the Pandora service. The |pydora package|_ is | ||
154 | a very small reference implementation of using the API to drive a command line | ||
155 | player. If you're interested in the command line skip this section and read | ||
156 | Installing below to get started. | ||
157 | |||
158 | The easiest way to get started is by using the |pandora.clientbuilder|_ | ||
159 | package. This package contains a set of factories that can be used to build a | ||
160 | Pandora 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 | ||
162 | details. All of the builders will return an instance of | ||
163 | |pandora.client.APIClient|_ that is completely configured and ready for use in | ||
164 | your program. | ||
165 | |||
166 | If you have an existing program and would like to connect to Pandora the | ||
167 | easiest 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 | |||
179 | At this point the client is ready for use, see |pandora.client.APIClient|_ for | ||
180 | a list of methods that can be called. All responses from the API will return | ||
181 | Python objects from the |pandora.models.pandora|_ package or raise exceptions | ||
182 | from |pandora.errors|_ | ||
183 | |||
184 | For a more functional example look at the file |pydora/player.py|_ which shows | ||
185 | how to use the API in a simple command line application. | ||
186 | |||
181 | Pandora API Spec and Partner Keys | 187 | Pandora API Spec and Partner Keys |
182 | ================================= | 188 | ================================= |
183 | The built-in ``pydora-configure`` script can be run to create a configuration | 189 | If you're interested in the underlying API or need to download the keys |
184 | file if you don't already have one. This will download the keys from the link | 190 | yourself you can find more details at the links below. This documentation is |
185 | below and pick a suitable one. If you're interested in the underlying API or | 191 | community maintained and not official. |
186 | need 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 | ||
195 | Contributors | 200 | Contributors |
196 | ============ | 201 | ============ |
202 | Thanks to the contributors who make Pydora possible by adding features and | ||
203 | fixing 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 | ||