From 93af278d6170cb38eeb189fe8deb957b98d20876 Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Fri, 24 Aug 2012 02:28:42 +0200 Subject: Add some docs. --- docs/index.rst | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 docs/index.rst (limited to 'docs/index.rst') diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..1797f76 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,95 @@ +.. livestreamer documentation master file, created by + sphinx-quickstart on Fri Aug 24 00:12:10 2012. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +livestreamer documentation +================================== + +Livestreamer is a library that can be used to retrieve information and stream data from +various livestreaming services, such as Twitch, Own3D or UStream. + + +.. automodule:: livestreamer + +Exceptions +---------- + +The :mod:`livstreamer` module defines four exceptions: + +.. exception:: PluginError + + Common base class for the plugin related exceptions. It inherits + :exc:`Exception`. + +.. exception:: NoStreamsError + + This exception is triggered when no streams can be found by a plugin. + It inherits :exc:`PluginError`. + +.. exception:: NoPluginError + + This exception is triggered when no plugin can found when calling :meth:`Livestreamer.resolve_url`. + It inherits :exc:`PluginError`. + +.. exception:: StreamError + + Common base class for stream related exceptions. It inherits + :exc:`Exception`. + +The livestreamer session +------------------------ +.. autoclass:: Livestreamer + :members: + +.. automodule:: livestreamer.plugins + +Plugins +------- +.. autoclass:: Plugin + :members: + +.. automodule:: livestreamer.stream + + +Streams +------- +.. autoclass:: Stream + :members: + + +Examples +-------- + +Fetching a streams data:: + + from livestreamer import Livestreamer + + url = "http://twitch.tv/day9tv" + livestreamer = Livestreamer() + channel = livestreamer.resolve_url(url) + streams = channel.get_streams() + + stream = streams["720p"] + fd = stream.open() + + while True: + data = fd.read(1024) + if len(data) == 0: + break + + # do something with data + + fd.close() + + + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + -- cgit v1.2.3