Skip to main content

Create spam mitigation models with ease using fully-customizable, object oriented components.

Project description

Spamfilter logo

spamfilter

PyPI - Downloads GitHub Actions Workflow Status PyPI - License

The spamfilter module is a lightweight, fast and straightforward Python package that helps you to build your own spam filtering pipelines in order to keep your applications featuring user-generated content clean.

It's object-oriented and makes a quick, concise approach to remove spam easy. spamfilter is highly configurable and ships with deep integrations for third-party APIs and language models via Ollama.


Important links

Installation

You can install spamfilter by cloning the GitHub repository, downloading it from the GitHub page or using pip - which is the recommended approach:

pip install spamfilter

Please see the installation guide for more information on how to install spamfilter and its dependencies, especially if you plan to use API or Ollama functionality.

Usage

Define a pipeline using several spam filters stacked onto each other.

from spamfilter.filters import Length, SpecialChars
from spamfilter.pipelines import Pipeline

# create a new pipeline
m = Pipeline([
    # length of 10 to 200 chars, crop if needed
    Length(min_length=10, max_length=200, mode="crop"),
    # limit use of special characters
    SpecialChars(mode="normal")
])

# test a string against it
TEST_STRING = "This is a test string."
print(m.check(TEST_STRING).passed)

Output:

True

License

This project is licensed under the MIT License, as declared in the LICENSE file.

Contributing

Feel free to contribute to the project using the GitHub repository. Additions to the spam filters, pipelines and documentation are always welcome!

Learn more here if you're interested in helping out!

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

spamfilter-2.0.1.tar.gz (511.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spamfilter-2.0.1-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file spamfilter-2.0.1.tar.gz.

File metadata

  • Download URL: spamfilter-2.0.1.tar.gz
  • Upload date:
  • Size: 511.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spamfilter-2.0.1.tar.gz
Algorithm Hash digest
SHA256 219b76ad5b18fb7cb6304b6f22bdd3ebfa765083ff679af742f31d9ab1e9fcd9
MD5 e20f8a405e870c0f25e811623fb2cbfe
BLAKE2b-256 8add58d0dfd248b291e31f72209162c494b6d57ee0b9a1e0035eb5c78501e452

See more details on using hashes here.

Provenance

The following attestation bundles were made for spamfilter-2.0.1.tar.gz:

Publisher: python-publish.yml on mags0ft/spamfilter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spamfilter-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: spamfilter-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spamfilter-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1800028000ce745b7d2d3b2fa70c369a2bbce224145f1025430bf9842f0a68a
MD5 47bbef2555f8843ea4cd1066375efb34
BLAKE2b-256 172d3322209114aa5e33d742ef15534bf7dcdaafa830fe029bdbb3f73c4adabb

See more details on using hashes here.

Provenance

The following attestation bundles were made for spamfilter-2.0.1-py3-none-any.whl:

Publisher: python-publish.yml on mags0ft/spamfilter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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