Other code and data#

The following additional items are part of the publicly-exported API of this module:

class akismet.CheckResponse[source]#

Possible response values from an Akismet content check, including the possibility of the “discard” response, modeled as an enum.IntEnum. See SyncClient.comment_check() and AsyncClient.comment_check() for details.

Has the following members:

HAM#

Indicates Akismet classified a piece of content as ham (i.e., not spam). Has integer value 0.

SPAM#

Indicates Akismet classified a piece of content as spam. Has integer value 1.

DISCARD#

Indicates Akismet classified a piece of content as “blatant” spam, suggesting that it be discarded without further review. Has integer value 2.

class akismet.Config(key: str, url: str)[source]#

A namedtuple() representing Akismet configuration, consisting of a key and a URL.

You only need to use this if you’re manually configuring an Akismet API client (which should be rare) rather than letting the validated_client() constructor automatically read the configuration from environment variables.

akismet.USER_AGENT#

A str containing the default User-Agent header value which will be sent with all requests to the Akismet web service. This is automatically derived from the akismet module version and Python version in use.

You generally will not need to use this value, but if you are passing a custom HTTP client to either SyncClient or AsyncClient, it can be useful to set this as the client’s User-Agent header, for consistency.