2121
2222Redacts and Unredacts the following from your text files. 📄 ✍️
2323
24- - names 👤
2524- sg nric 🆔
2625- credit cards 🏧
2726- domain names 🌐
@@ -46,6 +45,12 @@ Quick install
4645python -m pip install pyredactkit
4746```
4847
48+ Redact from terminal
49+
50+ ``` bash
51+ pyredactkit
' this is my ip:127.0.0.1. my email is [email protected] . secret link is github.com' 52+ ```
53+
4954Redact a single file
5055
5156``` bash
@@ -55,10 +60,16 @@ pyredactkit test.txt
5560Unredact the file
5661
5762``` bash
58- pyredactkit redacted_test.txt -u .hashshadow_test.txt.json
63+ pyredactkit -f redacted_test.txt -u .hashshadow_test.txt.json
5964```
6065
61- Install nltk data for redacting names
66+ Redact using custom regex pattern
67+
68+ ``` bash
69+ pyredactkit -f file -c custom.json
70+ ```
71+
72+ <!-- Install nltk data for redacting names
6273
6374```bash
6475python -c "import nltk
@@ -74,11 +85,11 @@ else:
7485nltk.download('popular')"
7586```
7687
77- Redact names from text file
88+ Redact names from a text file
7889
7990```bash
8091pyredactkit test.txt -t name
81- ```
92+ ``` -->
8293
8394### Use from github source
8495
@@ -190,12 +201,6 @@ e0b66cbd-6174-4491-b938-408a47d38fb9,Platinum,142000,CC90518
19020124f31233-cba6-4f6a-a2d6-0ce49952b2cb,Premium,781000,CC66746
191202` ` `
192203
193- To redact specific type of data. E.g (name)
194-
195- ` ` ` bash
196- poetry run pyredactkit test.txt -t name
197- ` ` `
198-
199204Sample result:
200205
201206` ` ` txt
@@ -217,7 +222,7 @@ My router is: 10.10.10.1
21722271.159.188.33
218223` ` `
219224
220- To redact multiple files from a directory and place it in a new directory
225+ To redact multiple files from a directory and place them in a new directory
221226
222227` ` ` bash
223228poetry run pyredactkit dir_test -d redacted_dir
@@ -226,28 +231,28 @@ poetry run pyredactkit dir_test -d redacted_dir
226231# # Optional Help Menu as below
227232
228233` ` ` bash
229- usage: pyredactkit [-h] [-u UNREDACT] [-t REDACTIONTYPE ] [-d DIROUT] [-r] [-e EXTENSION] file [file ...]
234+ usage: pyredactkit [-h] [-f FILE [FILE ...]] [-u UNREDACT ] [-d DIROUT] [-r] [-e EXTENSION] [text ...]
230235
231- Read in a file or set of files, and return the result.
236+ Supply a sentence or paragraph to redact sensitive data from it. Or read in a file or set of files with -f , and return the result.
232237
233238positional arguments:
234- file Path of a file or a directory of files. Usage: pyredactkit [file/filestoredact]
239+ text Redact sensitive data of a sentence from command prompt. (default: None)
235240
236241optional arguments:
237242 -h, --help show this help message and exit
243+ -f FILE [FILE ...], --file FILE [FILE ...]
244+ Path of a file or a directory of files. Usage: pyredactkit [file/filestoredact] (default: None)
238245 -u UNREDACT, --unredact UNREDACT
239- Option to unredact masked data. Usage: pyredactkit [redacted_file] -u [.hashshadow.json] (default: None)
240- -t REDACTIONTYPE, --redactiontype REDACTIONTYPE
241- Type of data to redact. names, nric, dns, emails, ipv4, ipv6, base64. Usage: pyredactkit [file/filestoredact] -t ip (default: None)
246+ Option to unredact masked data. Usage: pyredactkit -f [redacted_file] -u [.hashshadow.json] (default: None)
242247 -d DIROUT, --dirout DIROUT
243- Output directory of the file. Usage: pyredactkit [file/filestoredact] -d [redacted_dir] (default: None)
248+ Output directory of the file. Usage: pyredactkit -f [file/filestoredact] -d [redacted_dir] (default: None)
244249 -r, --recursive Search through subfolders (default: True)
245250 -e EXTENSION, --extension EXTENSION
246251 File extension to filter by. (default: )
247252` ` `
248253
249254# # Sample files
250255
251- - [All types of data](https://raw.githubusercontent.com/brootware/PyRedactKit/main/test /test.txt)
252- - [itcont.txt - 4GB uncompressed](https://sanitizationbq.s3.ap-southeast-1.amazonaws.com/itcont.tar.gz )
256+ - [All types of data](./logdata /test.txt)
257+ - [Differnt log file types](./logdata/ )
253258- [test_sample2.txt - 10002 lines of IP addresses](https://sanitizationbq.s3.ap-southeast-1.amazonaws.com/test_sample2.txt)
0 commit comments