{"id":37065454,"url":"https://github.com/jcp/datafilter","last_synced_at":"2026-01-14T07:39:44.906Z","repository":{"id":50185683,"uuid":"201791245","full_name":"jcp/datafilter","owner":"jcp","description":"Quickly find flags (words, phrases, etc) within your data. :male_detective:","archived":false,"fork":false,"pushed_at":"2022-12-26T20:59:40.000Z","size":91,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-01T15:15:20.270Z","etag":null,"topics":["csv","data-clean","data-cleansing","hate-speech-detection","parser","python","swear-filter","text","textfile"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-11T16:52:38.000Z","updated_at":"2019-09-09T14:21:03.000Z","dependencies_parsed_at":"2023-01-31T01:45:53.963Z","dependency_job_id":null,"html_url":"https://github.com/jcp/datafilter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jcp/datafilter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcp%2Fdatafilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcp%2Fdatafilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcp%2Fdatafilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcp%2Fdatafilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcp","download_url":"https://codeload.github.com/jcp/datafilter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcp%2Fdatafilter/sbom","scorecard":{"id":511813,"data":{"date":"2025-08-11","repo":{"name":"github.com/jcp/datafilter","commit":"844ddee4772dc65d886a29414c172369cc6c7e03"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"27 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2020-28 / GHSA-m6xf-fq7q-8743","Warn: Project is vulnerable to: PYSEC-2020-27 / GHSA-q65m-pv3f-wr5r","Warn: Project is vulnerable to: PYSEC-2020-340 / GHSA-vqhp-cxgc-6wmm","Warn: Project is vulnerable to: PYSEC-2021-865 / GHSA-vv2x-vrpj-qqpq","Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: PYSEC-2020-92 / GHSA-hj5v-574p-mj7c","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2021-140 / GHSA-9w8r-397f-prfh","Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p","Warn: Project is vulnerable to: PYSEC-2021-141 / GHSA-pq64-v7f5-gqh8","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: PYSEC-2020-149 / GHSA-hmv2-79q8-fv6g","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2020-148 / GHSA-wqvq-5m8c-6g24","Warn: Project is vulnerable to: PYSEC-2021-108","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T00:44:02.912Z","repository_id":50185683,"created_at":"2025-08-20T00:44:02.912Z","updated_at":"2025-08-20T00:44:02.912Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","data-clean","data-cleansing","hate-speech-detection","parser","python","swear-filter","text","textfile"],"created_at":"2026-01-14T07:39:44.395Z","updated_at":"2026-01-14T07:39:44.896Z","avatar_url":"https://github.com/jcp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Filter\n\n[![pypi](https://img.shields.io/pypi/v/datafilter.svg?color=brightgreen)](https://pypi.org/project/datafilter/)\n[![pypi](https://img.shields.io/pypi/pyversions/datafilter.svg)](https://pypi.org/project/datafilter/)\n[![codecov](https://codecov.io/gh/jcp/datafilter/branch/master/graph/badge.svg)](https://codecov.io/gh/jcp/datafilter/)\n[![Build Status](https://travis-ci.org/jcp/datafilter.svg?branch=master)](https://travis-ci.org/jcp/datafilter/)\n\nQuickly find tokens (words, phrases, etc) within your data.\n\nData Filter is a lightweight [data cleansing](https://en.wikipedia.org/wiki/Data_cleansing) framework that can be easily extended to support different data types, structures or processing requirements. It natively supports the following data types:\n\n* CSV files\n* Text files\n* Text strings\n\n# Table of Contents\n\n* [Requirements](#requirements)\n* [Installation](#installation)\n* [Basic Usage](#basic-usage)\n* [Features](#features)\n    * [Base](#base)\n    * [Filters](#filters)\n        * [CSV](#csv)\n        * [Text](#text)\n        * [TextFile](#textfile)\n\n# Requirements\n\n* Python 3.6+\n\n# Installation\n\nTo install, simply use [pipenv](http://pipenv.org/) (or pip):\n\n```bash\n\u003e\u003e\u003e pipenv install datafilter\n```\n\n# Basic Usage\n\n## CSV\n\n```python\nfrom datafilter import CSV\n\ntokens = [\"Lorem\", \"ipsum\", \"Volutpat est\", \"mi sit amet\"]\ndata = CSV(\"test.csv\", tokens=tokens)\ndata.save(\"filtered.csv\")\n```\n\nIn this example, we open a CSV file, search all rows for normalized tokens and flag them. The `save` method creates a new CSV file with all rows that weren't flagged.\n\n## Text\n\n```python\nfrom datafilter import Text\n\ntext = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit\"\ndata = Text(text, tokens=[\"Lorem\"])\nprint(next(data.results()))\n```\n\nIn this example, we search a text string for normalized tokens. We can then iterator over the results using the `.results()` method, which returns a generator that yields [formatted results](#parse).\n\n## Text File\n\n```python\nfrom datafilter import TextFile\n\ndata = TextFile(\"test.txt\", tokens=[\"Lorem\", \"ipsum\"], re_split=r\"(?\u003c=\\.)\")\nprint(next(data.results()))\n```\n\nIn this example, we open a text file and split the data based on a regular expression defined by `re_split`. \n\n# Features\n\nData Filter was designed to be highly extensible. Common or useful filters can be easily reused and shared. A few example use cases include:\n\n* Filters that can handle different data types such as Microsoft Word, Google Docs, etc.\n* Filters that can handle incoming data from external APIs.\n\n## Base\n\nAbstract base class that's subclassed by every filter.\n\n`Base` includes several methods to ensure data is properly normalized, formatted and returned. The `.results()` method is an `@abstractmethod` to enforce its use in subclasses.\n\n### Parameters\n\n#### `tokens`\n\n`type \u003clist\u003e`\n\nA list of strings that will be searched for within a set of data.\n\n#### `translations`\n\n`type \u003clist\u003e`\n\nA list of strings that will be removed during normalization.\n\n**Default**\n\n```python\n['0123456789', '(){}[]\u003c\u003e!?.:;,`\\'\"@#$%^\u0026*+-|=~–—/\\\\_', '\\t\\n\\r\\x0c\\x0b']\n```\n\n#### `bidirectional`\n\n`type \u003cbool\u003e`\n\nWhen `True`, token matching will be bidirectional. \n\n**Default**\n\n```python\nTrue\n```\n\n\u003e **Note:**\n\u003e\n\u003e A common obfuscation method is to reverse the offending string or phrase. This helps detect those instances.\n\n#### `caseinsensitive`\n\n`type \u003cbool\u003e`\n\nWhen `True`, tokens and data are converted to lowercase during normalization.\n\n**Default**\n\n```python\nTrue\n```\n\n### Methods\n\n#### `.results()`\n\nAbstract method used to return results within a filter. This is defined by a `Base` subclass\n\n#### `.maketrans()`\n\nReturns a translation table used during normalization.\n\n**Returns**\n\n`type \u003cdict\u003e`\n\n#### `.normalize(data)`\n\nReturns normalized data. Normalization includes converting data to [lowercase](#caseinsensitive) and [removing strings](#translations).\n\nAccepts parameter `data`.\n\n**Returns**\n\n`type \u003ctuple\u003e`\n\n\u003e **Note:**\n\u003e\n\u003e Normalized data is returned as a tuple. The first element is the original data. The second element is the normalized data.\n\u003e\n\n#### `.parse(data)`\n\nReturns parsed and formatted data.\n\nAccepts parameter `data`.\n\n**Returns**\n\n`type \u003cdict\u003e`\n\n**Example**\n\nAssume we're searching for the token \"Lorem\" in a very short text string.\n\n```python\ndata = Text(\"Lorem ipsum dolor sit amet\", tokens=[\"Lorem\"])\nprint(next(data.results()))\n```\n\nThe returned result would be formatted as:\n\n```python\n{\n    \"data\": \"Lorem ipsum dolor sit amet\",\n    \"flagged\": True,\n    \"describe\": {\n        \"tokens\": {\n            \"detected\": [\"Lorem\"],\n            \"count\": 1,\n            \"frequency\": {\n                \"Lorem\": 1,\n            },\n        }\n    },\n}\n```\n\n\u003e **Note:**\n\u003e\n\u003e `.parse()` should never be called directly. Use `.results()` instead.\n\n## Filters\n\nFilters subclass and extend the `Base` class to support various data types and structure. This extensibility allows for the creation of powerful custom filters specifically tailored to a given task, data type or structure.\n\n## CSV\n\n### Parameters\n\n`CSV` is a subclass of `Base` and inherits all parameters.\n\n#### `path`\n\n`type \u003cstr\u003e`\n\nPath to a CSV file.\n\n### Methods\n\n`CSV` is a subclass of `Base` and inherits all methods.\n\n#### `.save(path)`\n\nSaves results to a file.\n\nAccepts parameter `path`. `path` is the absolute path and filename of the new file.\n\n## Text\n\n### Parameters\n\n`Text` is a subclass of `Base` and inherits all parameters.\n\n#### `text`\n\n`type \u003cstr\u003e`\n\nA text string.\n\n#### `re_split`\n\n`type \u003cstr\u003e`\n\nA regular expression pattern or string that will be applied to `text` with `re.split` before normalization.\n\n### Methods\n\n`Text` is a subclass of `Base` and inherits all methods.\n\n#### `.save(path, endofline=\" \")`\n\nSaves results to a file.\n\nAccepts parameter `path` and `endofline`. `path` is the absolute path and filename of the new file. `endofline` is a line delimiter that will be added to the end of every row.\n\n## TextFile\n\n### Parameters\n\n`TextFile` is a subclass of `Base` and inherits all parameters.\n\n#### `path`\n\n`type \u003cstr\u003e`\n\nPath to a text file.\n\n#### `re_split`\n\n`type \u003cstr\u003e`\n\nA regular expression pattern or string that will be applied to `text` with `re.split` before normalization.\n\n### Methods\n\n`TextFile` is a subclass of `Base` and inherits all methods.\n\n#### `.save(path, endofline=\" \")`\n\nSaves results to a file.\n\nAccepts parameter `path` and `endofline`. `path` is the absolute path and filename of the new file. `endofline` is a line delimiter that will be added to the end of every row.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcp%2Fdatafilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcp%2Fdatafilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcp%2Fdatafilter/lists"}