Skip to content
The Akismet Python library with some fixes.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


# Version 0.2.0
# Copyright Michael Foord 2005-2009
# Python interface to the akismet API
# E-mail


# Released subject to the BSD License
# See

A python interface to the `Akismet <>`_ API.
This is a web service for blocking SPAM comments to blogs - or other online 

You will need a Wordpress API key, from ` <>`_.

You should pass in the keyword argument 'agent' to the name of your program,
when you create an Akismet instance. This sets the ``user-agent`` to a useful

The default is : ::

    Python Interface by Fuzzyman |

Whatever you pass in, will replace the *Python Interface by Fuzzyman* part.
**0.2.0** will change with the version of this interface.

Usage example::
    from akismet import Akismet
    api = Akismet(agent='Test Script')
    # if apikey.txt is in place,
    # the key will automatically be set
    # or you can call api.setAPIKey()
    if api.key is None:
        print "No 'apikey.txt' file."
    elif not api.verify_key():
        print "The API key is invalid."
        # data should be a dictionary of values
        # They can all be filled in with defaults
        # from a CGI environment
        if api.comment_check(comment, data):
            print 'This comment is spam.'
            print 'This comment is ham.'

Something went wrong with that request. Please try again.