pycrm114
Pythonic bindings for crm114
CRM114 - the Controllable Regex Mutilator
CRM114 is a system to examine incoming e-mail, system log streams, data files or other data streams, and to sort, filter, or alter the incoming files or data streams according to the user’s wildest desires.
—crm114.sourceforge.net
Quickstart
No persistence
import pycrm114
crm = pycrm114.CRM114(classes=["spam", "ham"])
crm.learn("spam", "foo bar")
crm.learn("ham", "bar is good")
assert crm.classify("is bar good")["class"] == "ham"
assert crm.classify("foo bar good")["class"] == "spam"
crm.forget("spam", "foo bar")
assert crm.classify("foo bar good")["class"] == "ham"
File System Persistence
import pycrm114
crm = pycrm114.CRM114(
classes=["spam", "ham"],
storage=pycrm.storage.FileSystemStorage("/var/tmp/crm-test")
)
crm.learn("spam", "foo bar")
crm.learn("ham", "bar is good")
crm.save()
new_crm = pycrm114.CRM114(
classes=["spam", "ham"],
storage=pycrm.storage.FileSystemStorage("/var/tmp/crm-test")
)
assert new_crm.classify("is bar good")["class"] == "ham"
assert new_crm.classify("foo bar good")["class"] == "spam"
Dependencies
Debian/Ubuntu: sudo apt-get install libtre5 libtre-dev
OS X: brew install tre
Tests
Dependencies
pip install -r requirements/test.txt
To test against different python versions use tox:
tox
To run the tests with the active python:
python setup.py build && nosetests tests
Building
python setup.py build
References
Changelog
0.2.3 2015-04-19
Documentation tweaks
0.2.2 2015-04-18
Added a forget method to unlearn a text from a class
0.2.0 2015-04-18
Python 3 compatibility
Added a Pythonic wrapper with a potentially pluggable storage backend
Support for dumping control block/data block to string instead of file
Added basic tests
0.1.0 2015-04-10
Initial import from pmundkur/libcrm114
Metadata
Release files for pycrm114 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycrm114-0.2.3.tar.gz | 244.1 kB | Without provenance | Details for pycrm114-0.2.3.tar.gz |
Release files / pycrm114-0.2.3.tar.gz
| Download URL | pycrm114-0.2.3.tar.gz |
|---|---|
| Size | 244.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34eeefa66fd45afea5a96e54de3bcf912c7f1b0e91a8582cef18746f18165295
|
|
BLAKE2b-256 checksum How to use checksums |
05418622fa99a2dafdc27b85ee5af747d9ceeffb6fe417116ba7de9a5a24d913
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pycrm114 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.