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:
hamprobable_spamdefinite_spamunknown
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| akismet-async-0.0.1.tar.gz | 3.7 kB | Without provenance |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| akismet_async-0.0.1-py3-none-any.whl | Python 3 | none | any |
Total release size: 7.9 kB
Security for akismet-async 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.