File tree Expand file tree Collapse file tree 5 files changed +10
-12
lines changed
Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44
55[tool .poetry ]
66name = " pyredactkit"
7- version = " 0.3.4 "
7+ version = " 0.3.5 "
88description = " Python cli tool to redact sensitive data"
99authors = [
" brootware <[email protected] >" ]
1010license = " GPL-3.0-or-later"
Original file line number Diff line number Diff line change 11__version__ = "0.1.0"
22
3- from pyredactkit import pyredactkit
3+ from pyredactkit import runner
44
55if __name__ == "__main__" :
6- pyredactkit .main ()
6+ runner .main ()
Original file line number Diff line number Diff line change 2424 )
2525 sys .exit (1 )
2626
27- from pyredactkit import pyredactkit
27+ from pyredactkit import runner
2828
29- pyredactkit .main ()
29+ runner .main ()
Original file line number Diff line number Diff line change @@ -35,20 +35,18 @@ def __init__(self) -> None:
3535 """
3636 return None
3737
38- def identify_data (self , line : str ) -> list :
38+ def identify_data (self , textchunk : str ) -> list :
3939 """Function to identify specific option
4040 Args:
41- line (str) : line to be supplied to identify pattern
41+ textchunk (str) : textchunk to be supplied to identify pattern
4242 Returns:
4343 list (list): list of sensitive data found in lines
4444 """
4545 sensitive_data = []
4646 for id in id_object .regexes :
4747 redact_pattern = id ['pattern' ]
48- if re .search (redact_pattern , line ):
49- pattern_string = re .search (redact_pattern , line )
50- pattern_string = pattern_string .group (0 )
51- sensitive_data .append (pattern_string )
48+ sensitive_data .append (re .findall (redact_pattern , textchunk ))
49+ sensitive_data = sum (sensitive_data , [])
5250 return sensitive_data
5351
5452 def redact_all (self , line : str ) -> tuple :
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ def main():
143143 redact_obj .process_text (args .text )
144144
145145
146- def api_return_core_identifier (text : str ) -> list :
146+ def api_identify_sensitive_data (text : str ) -> list :
147147 return redact_obj .identify_data (text )
148148
149149
You can’t perform that action at this time.
0 commit comments