Create spam mitigation models with ease using fully-customizable, object oriented components.
Project description
spamfilter
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
- 🌎 Website and documentation
- 🔓 Report a security vulnerability
- 🚩 Create a new issue
- 👩💻 How to contribute
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
219b76ad5b18fb7cb6304b6f22bdd3ebfa765083ff679af742f31d9ab1e9fcd9
|
|
| MD5 |
e20f8a405e870c0f25e811623fb2cbfe
|
|
| BLAKE2b-256 |
8add58d0dfd248b291e31f72209162c494b6d57ee0b9a1e0035eb5c78501e452
|
Provenance
The following attestation bundles were made for spamfilter-2.0.1.tar.gz:
Publisher:
python-publish.yml on mags0ft/spamfilter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spamfilter-2.0.1.tar.gz -
Subject digest:
219b76ad5b18fb7cb6304b6f22bdd3ebfa765083ff679af742f31d9ab1e9fcd9 - Sigstore transparency entry: 248518527
- Sigstore integration time:
-
Permalink:
mags0ft/spamfilter@37ca08820b82c6b0e113a6e2827b73e840fa8de6 -
Branch / Tag:
- Owner: https://github.com/mags0ft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@37ca08820b82c6b0e113a6e2827b73e840fa8de6 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1800028000ce745b7d2d3b2fa70c369a2bbce224145f1025430bf9842f0a68a
|
|
| MD5 |
47bbef2555f8843ea4cd1066375efb34
|
|
| BLAKE2b-256 |
172d3322209114aa5e33d742ef15534bf7dcdaafa830fe029bdbb3f73c4adabb
|
Provenance
The following attestation bundles were made for spamfilter-2.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on mags0ft/spamfilter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spamfilter-2.0.1-py3-none-any.whl -
Subject digest:
e1800028000ce745b7d2d3b2fa70c369a2bbce224145f1025430bf9842f0a68a - Sigstore transparency entry: 248518528
- Sigstore integration time:
-
Permalink:
mags0ft/spamfilter@37ca08820b82c6b0e113a6e2827b73e840fa8de6 -
Branch / Tag:
- Owner: https://github.com/mags0ft
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@37ca08820b82c6b0e113a6e2827b73e840fa8de6 -
Trigger Event:
release
-
Statement type: