Skip to main content

A Python library for the Mollom anti-spam service

Project description

A Python library for the Mollom anti-spam service.

Example:

from Mollom import MollomAPI
from Mollom import MollomFault

def content_is_spam(content):
    mollom_api = MollomAPI(
        publicKey=MOLLOM_PUBLIC_KEY,
        privateKey=MOLLOM_PRIVATE_KEY)
    if not mollom_api.verifyKey():
        raise MollomFault('Your MOLLOM credentials are invalid.')

    cc = mollom_api.checkContent(postBody=content)
    # cc['spam']: 1 for ham, 2 for spam, 3 for unsure;
    # http://mollom.com/blog/spam-vs-ham
    if cc['spam'] == 2:
        return True
    return False

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

PyMollom-0.1.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file PyMollom-0.1.tar.gz.

File metadata

  • Download URL: PyMollom-0.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyMollom-0.1.tar.gz
Algorithm Hash digest
SHA256 bd3f43129f569212a2a3309a7ba371d4d168b0af92ccb046f17550eb8c995c98
MD5 8c718a81e921e791474940c264b76fab
BLAKE2b-256 160640a918884530fddc9f17db7dd9921e0f9d1b9f3638bee7e9d84aeeed88aa

See more details on using hashes here.

Supported by

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