Using the Python Success Stories Web API
You can obtain the Python Success Stories in ReST and HTML format,
in order to host them on your own website. All story authors have given
consent for their story to be distributed in this way.
ReST can be processed down to HTML and other document formats using docutils. The HTML is a generic
HTML4 page with external CSS1 style sheet.
Obtaining a Story List
You can obtain a list of all the available stories using the following URL:
http://pythonology.org/success&list=1&noheader=1
This returns a list of available stories, with each list item on a seperate line.
Each item is a sequence of tab seperated fields in this order:
- Story name: String
- Category: String; one of Business, Science, Comparison, or Hobby.
- Keywords: String; a list of keywords. Stories include
those relevant from at least the following base set: cpython, jython, zope, plone,
mod_python, cgi, pyqt, wxpython, tkinter, pygtk, web, cgi, webservice, xml, soap, wsdl,
rad, testing, imaging, 3dmodeling, numeric, visualization, database, swig, win32all,
win32com, pygame, twisted, enterprise, integration, scripting, missioncritical, prototyping
(this set may be expanded over time)
- Title: String
- Author(s): String
- Website: Url as string; may be None
- Summary: String
- Date: String in YYYY-MM-DD HH:MM:SS format
- Company logo url: Url as string; may be None
- Base url to obtain the story in ReST format
- Base url to obtain the story in HTML format
Obtaining a Story
Use the given base URL to obtain a story in ReST or HTML format. You can
add the following parameters to control the content of the output:
&prune=item1[+item2...] -- Specify the document info items
to prune from the output. If not pruned, they appear in the ReST as docinfo
items or in the HTML as part of the document after the title. If multiple
items are given, seperate them with '+'. Items may include: category, keywords, title,
author, website, summary, date, logo. By default, if this argument is omitted,
the document will be pruned of category, keywords, title, summary, and logo. Specify
&prune=none to include all of the docinfo items.
&stylesheet=path -- Specify the stylesheet to use in HTML
output (ignored in ReST output). Use '|' for '/' in urls or path names
given for this value. By default, it is set to
http://pythonology.org/images/default.css.
Notes
Image directories given in the output documents are the fully qualified
URLs for those images on pythonology.org. Feel free to harvest and transfer
images and alter these URLs in your copy of the stories.
See this example Python code for
code snippets and utilities useful in obtaining the story list or a specific
story, converting from ReST to HTML, and for post-processing the HTML pages.
|
|