python-bashquote

This is a Python library for accessing and printing quotes from bash.org, a quote database on the Internet from various chat sources. It is NOT made by bash.org, or endorsed by them in any way. Note that it merely uses HTML parsing to filter through the site's content
The BashQuote object can be created directly (BashQuote(8)) or it can be created using various functions. getQuoteSafe and getQuote take a quote number and return a quote object- getQuoteSafe checks to verify the quote exists. Then, getLatestQuote and getRandomQuote will both do HTML parsing to find the quote numbers.

These BashQuote objects then have various helper functions which can return various data about a quote. So, for instance, to get the text of a random quote, BashQuote.getText() will print out all the text. Or to check if a quote is pending, isPending() will return true if the quote has yet to be processed for approval, and so on.

Released by Ben Rosser in 2012 under the MIT license (see below).

History

This began as a Python script that was part of an IRC bot I created. I had added a command (!bash rand) which would return a random bash.org quote into a channel. This proved to be a very popular command, and so over time I tried to improved the code I had written to do this task. The project expanded over time, and I ended up with a library I called bashDotOrg 1.0.

I never got around to releasing this library, probably because "BashDotOrg" was a dumb name for a library. But now, two years later, I've modified it, renamed it to the much saner "bashquote", and improved the code a bit to the point where I'm willing to publish it as an independent project.

Installation

This module is now in PyPI, so the easiest way to install it is to use pip (pip install bashquote). Alternatively, grab it from PyPI here.

Legal

Copyright (c) 2012 Ben Rosser

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. "