From c34c6754001592d3831e111e0609a9cf1bbd4ce8 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Sat, 16 Aug 2014 19:38:04 -0400 Subject: Update the documentation --- README.rst | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 75 insertions(+), 9 deletions(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index 44eff08..98aa1f4 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -Python-pushover aims at being a comprehensive Python API implementation of the -`Pushover Notification Service`_ as documented here__. +``python-pushover`` aims at providing comprehensive Python bindings for the API +of the `Pushover Notification Service`_ as documented here__. .. _Pushover Notification Service: https://pushover.net/ .. __: https://pushover.net/api @@ -7,8 +7,11 @@ Python-pushover aims at being a comprehensive Python API implementation of the Installation ------------ -You can install python-pushover directly from Pypi_ with ``pip install -python-pushover`` or ``easy_install python-pushover``. +You can install python-pushover from Pypi_ with: + +.. code-block:: bash + + $ pip install python-pushover Or you can install it directly from GitHub_: @@ -16,14 +19,77 @@ Or you can install it directly from GitHub_: git clone https://github.com/Thibauth/python-pushover.git cd python-pushover - python setup.py install + pip install . .. _Pypi: https://pypi.python.org/pypi/python-pushover/ .. _GitHub: https://github.com/Thibauth/python-pushover -Documentation -------------- +Overview +-------- + +After being imported, the module must be initialized by calling the ``init`` +function with a valid application token. Thus, a typical use of the +``pushover`` module looks like this: + +.. code-block:: python + + from pushover import init, Client + + init("") + client = Client("").send_message("Hello!", title="Hello") + +You can also pass the ``api_token`` optional argument to ``Client`` to +initialize the module at the same time: + +.. code-block:: python + + from pushover import Client + + client = Client("", api_token="") + client.send_message("Hello!", title="Hello") + +Command line +~~~~~~~~~~~~ + +``python-pushover`` also comes with a command line utility ``pushover`` that +you can use as follows: + +.. code-block:: bash + + pushover --api-token --user-key "Hello!" + +Use ``pushover --help`` to see the list of available options. + +Configuration +~~~~~~~~~~~~~ + +Both the ``pushover`` module and the ``pushover`` command line utility support +reading arguments from a configuration file. + +The most basic configuration file looks like this: + +.. code-block:: ini + + [Default] + api_token=aaaaaa + user_key=xxxxxx + +You can have additional sections and specify a device as well: + +.. code-block:: ini + + [Sam-iPhone] + api_token=bbbbbb + user_key=yyyyyy + device=iPhone + +``python-pushover`` will attempt to read the configuration from +``~/.pushoverrc`` by default. The section to read can be specified by using the +``profile`` argument. + +API +--- -You can access the full documentation here__. +You can access the full API documentation here__. -.. __: http://pythonhosted.org/python-pushover +.. __: http://pythonhosted.org/python-pushover/#module-pushover -- cgit v1.2.3-70-g09d2