Skip to main content

Create spam filtering and mitigation pipelines with ease using fully-customizable, object oriented components.

Project description

Spamfilter logo

spamfilter

PyPI - Downloads GitHub Actions Workflow Status PyPI - License

spamfilter is a lightweight, fast and straightforward Python library 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, 🤗 Transformers AI/ML text classifiers and language models via OpenAI.


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 and methods on how to install spamfilter and its dependencies, especially if you plan to use API or machine learning functionality as this requires additional dependencies.

Usage

The most basic primer into the spamfilter library is defining a pipeline using several filters stacked on top of 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_=10, max_=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 published under the MIT License.

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-3.0.0.tar.gz (516.5 kB view details)

Uploaded Source

Built Distribution

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

spamfilter-3.0.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spamfilter-3.0.0.tar.gz
Algorithm Hash digest
SHA256 131d5e9d4ec00a0e157006b3610637cf77d9eb7523798e88ad9fbabb08ccf11a
MD5 ec089cb467c1e7aac2250e20c9597c9d
BLAKE2b-256 fdd6ac1059d8d4c6596dd06e39283db678850bc9ca4acd3b091c867694368126

See more details on using hashes here.

Provenance

The following attestation bundles were made for spamfilter-3.0.0.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-3.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for spamfilter-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b3064f10ea4d65422f1d0070c5e73207f15a298b4efa16d0eacb4c398d2682b
MD5 0287d05557ebd3e2536ef380e74a9807
BLAKE2b-256 397c722f134c62c1f19520b76d88c402b8a10e745ad3c124d84fa039de26b7d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spamfilter-3.0.0-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