How to use the scrubadub.scrubbers.Scrubber function in scrubadub

To help you get started, we’ve selected a few scrubadub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github datascopeanalytics / scrubadub / tests / test_urls.py View on Github external
def check_keep_domain(self):
        """convenience method for runnint tests with the keep_domain kwarg"""
        before, after = self.get_before_after()
        scrubber = scrubadub.scrubbers.Scrubber()
        result = scrubber.clean_urls(
            before,
            replacement="path/to/something",
            keep_domain=True,
        )
        self.check_equal(after, result)
github datascopeanalytics / scrubadub / scrubadub / scrubbers.py View on Github external
def __init__(self, *args, **kwargs):
        super(Scrubber, self).__init__(*args, **kwargs)

        # instantiate all of the detectors which, by default, uses all of the
        # detectors that are in the detectors.types dictionary
        self._detectors = {}
        for detector_cls in detectors.iter_detector_clss():
            self.add_detector(detector_cls)