Skip to main content

Akismet v1.1 module for Python.

Project description

Latest Travis CI build status Latest PyPI version Python versions Code Climate Test coverage Requirements Status

Python-akismet

Pykismet3 fork. Support older versions of Python and improvements.

Supported API

The Following Akismet API Calls are currently supported:

  • Comment Check

  • Submit Ham

  • Submit Spam

Unsupported API

The following Akismet API Calls are not yet supported: * Key Verification

Installation

  1. Signup for Akismet and get yourself an API key at http://akismet.com/plans/ (You don’t need to pay)

  2. Install this library:

    pip install python-akismet
  3. Make some calls to Akismet (see example below to get started)

Example

Import and instance Akismet.

from akismet import Akismet

# API KEY (first argument) is required. blog can be defined later.
akismet = Akismet('1ba29d6f120c', blog="http://your.blog/url",
                  user_agent="My Application Name/0.0.1")

Comment Check

akismet.check('192.168.1.3', 'Firefox / COMMENT USER AGENT', comment_author='King Arthur',
              comment_author_email='arthur@camelot.co.uk', comment_author_url='http://camelot.co.uk',
              comment_content='The Lady of the Lake, her arm clad in the purest shimmering samite, '
                               'held aloft Excalibur from the bosom of the water, signifying by divine'
                               ' providence that I, Arthur, was to carry Excalibur. That is why I '
                               'am your king.', referrer='http://camelot-search/?q=Peasant+Woman')

Submit Ham

akismet.submit_ham('192.168.1.12', 'FIREFOX / COMMENT USER AGENT', comment_author='Tim',
                   comment_author_email='tim@witch.co.uk',
                   comment_author_url='http://witch.co.uk',
                   comment_content="Look, that rabbit's got a vicious streak a mile wide!"
                                   "It's a killer!")

Submit Spam

akismet.submit_spam('192.168.1.4', 'FIREFOX / COMMENT USER AGENT', comment_author='Frenchman',
                    comment_author_email='frenchman@guy-de-lombard.fr',
                    comment_author_url='http://guy-de-lombard.fr',
                    comment_content="You don't frighten us, English pig-dogs! Go and boil your "
                                    "bottoms, sons of a silly person! I blow my nose at you, "
                                    "so-called Ah-thoor Keeng, you and all your silly English "
                                    "K-n-n-n-n-n-n-n-niggits!")

Documentation

The examples above show you pretty much everything you need to know.

For a full list of supported parameters for each API call, see http://akismet.com/development/api/

The code is only ~100 lines long anyway, so just look at ‘’’akismet’’’ if you aren’t sure about something.

Project details


Download files

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

Source Distribution

python-akismet-0.2.2.tar.gz (9.1 kB view details)

Uploaded Source

File details

Details for the file python-akismet-0.2.2.tar.gz.

File metadata

File hashes

Hashes for python-akismet-0.2.2.tar.gz
Algorithm Hash digest
SHA256 cd10a83fe11a86116100ed4aaca10c835c3ac924b961303df9a8fecbc0e6b189
MD5 8f556aa1c3184a3af15359fa85422e27
BLAKE2b-256 fec3eef4b17ac56b4b571f3a4cda88af2b24cc5545931008ae32dc2df09a63a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page