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

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, 🤗 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 OpenAI functionality.

Usage

The most basic primer into the spamfilter library is to 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.2.0.tar.gz (516.0 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.2.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spamfilter-2.2.0.tar.gz
Algorithm Hash digest
SHA256 a9eeaeafb4ae786a74817b15149904b00aa5e01278a316712aeeeb9183c9b27e
MD5 e6d115bf71739d0ebd70d944c60ea367
BLAKE2b-256 a4eb0d06efdd48f9999c66966984a9b33863e2514a3e3443d3396b7866762622

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for spamfilter-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3cf5469f44607d056eb599d697b67758537fa1149eeb5c041ce79ccd29b293
MD5 49699ac7d05c663f27a9bb3626d8107a
BLAKE2b-256 dd4b05000b055e42c3943cba9abc57e85ff548a275f2568b8ba1e1b33cdadb34

See more details on using hashes here.

Provenance

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