Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Query a Seinfeld quote database

Project Description

Python library for querying Seinfeld quotes.

Depends on a database generated using scripts by Colin Pollick.


libseinfeld is compatible with Python 2.7 and Python 3.3+. You can install it from PyPI with the following command:

$ pip install seinfeld

libseinfeld requires a local copy of the Seinfeld quote database. You can build it by following the instructions on the seinfeld-scripts repo, or you can download a prebuilt copy with the following command:

$ wget


First thing is to import libseinfeld and create a connection to the local database:

>>> from seinfeld import Seinfeld
>>> seinfeld = Seinfeld(<path to seinfeld.db>)

To get information on individual episodes or seasons:

>>> seinfeld.season(1).episodes.keys()
[1, 2, 3, 4]

>>> seinfeld.season(1).episodes[1].title
u'Good News, Bad News'

>>> seinfeld.season(1).episodes[1].writers[0]
u'Jerry Seinfeld'

>>> seinfeld.season(1).episodes[1].date, 6, 14)

Quotes can be retrieved by unique ID:

>>> quote = seinfeld.quote(34665)
>>> quote.text
u'The show is about nothing.'


>>> quote.episode.title
u'The Pitch'

Searching for quotes is simple:

>>>'Jerry', subject='keys')
[Quote(...), ...]

Searches are limited to ten quotes by default, but you can get more or less. To get all the quotes, in order, for a given episode:

>>> episode = seinfeld.season(1).episodes[1]
>>> quotes =, limit=None)
>>> len(quotes)

You can even get random quotes by search query:

>>> seinfeld.random(speaker='George')

If you’d like context around an individual quote, you can get a passage:

>>> passage = seinfeld.passage(quote)
>>> len(passage.quotes)


Copyright 2016 John Reese, and licensed under the MIT license. See the LICENSE file for details.

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(5.0 kB) Copy SHA256 Hash SHA256
Source None Jan 17, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers