Skip to main content

akismet-async

An asyncronous Python 3 Akismet client library.

Installation

pip install akismet-async

API key verification

Get your Akismet API key here.

from akismet import Akismet, Comment

akismet_client = Akismet(api_key="YOUR_AKISMET_API_KEY" blog="http://your.blog/",
                user_agent="My App/1.0.0")

await akismet_client.verify_key()

Example usage

You can check a comment's spam score by creating a dictionary or a Comment() object for greater type safety:

from akismet import Akismet, Comment

akismet_client = Akismet(api_key="YOUR_AKISMET_API_KEY" blog="http://your.blog/",
                user_agent="My App/1.0.0")

comment = Comment(
    comment_content="This is the body of the comment",
    user_ip="127.0.0.1",
    user_agent="some-user-agent",
    referrer="unknown"
)

first_spam_status = await akismet_client.check(comment)

second_spam_status = await akismet_client.check(
    {
        "user_ip": "127.0.0.2",
        "user_agent": "another-user-agent",
        "referrer": "unknown",
        "comment_content": "This is the body of another comment",
        "comment_author": 'John Doe',
        "is_test": True,
    }
)

check() returns one of the following strings:

  • ham
  • probable_spam
  • definite_spam
  • unknown

Submit Ham

If you have determined that a reported comment is not spam, you can report the false positive to Akismet:

await akismet_client.submit_ham(comment)

Submit Spam

If a spam comment passes the Akismet check, report it to Akismet:

await akismet_client.submit_spam(comment)

Metadata

Release files for akismet-async 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akismet-async 0.0.1
File Size Uploaded
akismet-async-0.0.1.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for akismet-async 0.0.1
File Interpreter ABI Platform
akismet_async-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 kB

Release files / akismet-async-0.0.1.tar.gz

Download URL akismet-async-0.0.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1ff2183441b7420a6af9564e4c33695834d94bd02ee73aca7cccc3cdb24c6bcb
BLAKE2b-256 checksum
How to use checksums
2d895357dee3b45b88eb2143e11d17d6bd1e3bc12e7f20c121f4bd0a412b09c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Darwin/19.6.0

Release files / akismet_async-0.0.1-py3-none-any.whl

Download URL akismet_async-0.0.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6aabe9c51d7f8716939725dd63d4405c5c17f28ba37aff3673e15fd18f49370a
BLAKE2b-256 checksum
How to use checksums
e3c588d17b351c4d887a0343853d793b26d8ce636375355e866ae218a27a515c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Darwin/19.6.0

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page