Commits

Evgeniy Tatarkin  committed e0894d3

docs - minimal application

  • Participants
  • Parent commits b76e719

Comments (0)

Files changed (5)

 .cibox
 dist/
 html_docs/
+docs/_build/

File docs/api.rst

+API
+---
+
+.. module:: pomp.core.base
+
+This part of the documentation documents all the public classes and
+functions in pomp.
+
+.. autoclass:: BaseCrawler
+    :members: extract_items, next_url

File docs/contents.rst.inc

+User's Guide
+------------
+
+This part of the documentation will show you how to get started in using Pomp.
+
+.. toctree::
+   :maxdepth: 2
+
+   quickstart
+
+
+API Reference
+-------------
+
+If you are looking for information on a specific function, class or
+method, this part of the documentation is for you.
+
+.. toctree::
+   :maxdepth: 2
+
+   api

File docs/index.rst

-.. pomp documentation master file, created by
-   sphinx-quickstart on Sun Jan 20 12:09:48 2013.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
+:orphan:
 
-Welcome to pomp's documentation!
-================================
+Pomp
+====
 
-Contents:
+.. module:: pomp.engine
 
-.. toctree::
-   :maxdepth: 2
+Pomp is an screen scraping framework like `Scrapy`_ but more simple and
+without hard `Twisted`_ dependency.
 
+Main goal of project - easy extracting structured data from lots of sources
 
+.. _Scrapy: http://scrapy.org/
+.. _Twisted: http://twistedmatrix.com/
+.. _example sourcecode:
+   https://bitbucket.org/estin/pomp/src/tip/examples?at=default
 
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
+.. include:: contents.rst.inc

File docs/quickstart.rst

+.. _quickstart:
+
+Quickstart
+==========
+
+.. currentmodule:: pomp.core.base
+
+Pomp is fun to use, incredibly easy for basic applications.
+
+A Minimal Application
+---------------------
+
+For a minimal application all you need is to define you crawler inherited 
+from :class:`BaseCrawler`::
+
+    from pomp.core.base import BaseCrawler
+    from pomp.contrib import SimpleDownloader
+
+
+    class MyCrawler(BaseCrawler):
+        ENTRY_URL = 'http://python.org/news' # entry point
+
+        def extract_items(self, response):
+            response.body = response.body.decode('utf-8')
+            return None
+
+        def next_url(self, response):
+            return None # one page crawler, stop crawl
+
+    if __name__ == '__main__':
+        from pomp.core.engine import Pomp
+
+        pomp = Pomp(
+            downloader=SimpleDownloader(),
+        )
+
+        pomp.pump(MyCrawler())