pdfalyzer 1.17.2__py3-none-any.whl → 1.17.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pdfalyzer might be problematic. Click here for more details.

CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # NEXT RELEASE
2
2
 
3
+ ### 1.17.3
4
+ * Put back `--debug` arg for CLI tools
5
+
3
6
  ### 1.17.2
4
7
  * Remove unused `--debug` args for CLI tools
5
8
  * Rename `extract_text_from_pdfs` to `extract_pdf_text`
@@ -215,10 +215,3 @@ class PdfFile:
215
215
  return
216
216
 
217
217
  stderr_console.print(msg, style=style or "")
218
-
219
- # def _num_pages(self) -> int:
220
- # pdf_reader = PdfReader(self.file_path)
221
- # page_count = len(pdf_reader.pages)
222
- # log.debug(f"PDF Page count: {page_count}")
223
-
224
- # for page_number, page in enumerate(pdf_reader.pages, start=1):
@@ -5,6 +5,7 @@ Argument parsers for the command line tools other than `pdfalyze` that are inclu
5
5
  2. extract_pdf_pages
6
6
  3. extract_pdf_text
7
7
  """
8
+ import logging
8
9
  import sys
9
10
  from argparse import ArgumentParser, Namespace
10
11
  from pathlib import Path
@@ -88,6 +89,7 @@ extract_pdf_parser = ArgumentParser(
88
89
  )
89
90
 
90
91
  extract_pdf_parser.add_argument('pdf_file', metavar='PDF_FILE', help='PDF to extract pages from')
92
+ extract_pdf_parser.add_argument('--debug', action='store_true', help='turn on debug level logging')
91
93
 
92
94
  extract_pdf_parser.add_argument('--page-range', '-r',
93
95
  type=page_range_validator,
@@ -109,6 +111,7 @@ def parse_pdf_page_extraction_args() -> Namespace:
109
111
  log.error(f"Destination dir '{args.destination_dir}' does not exist.")
110
112
  sys.exit(1)
111
113
 
114
+ _set_log_level(args)
112
115
  return args
113
116
 
114
117
 
@@ -122,6 +125,7 @@ extract_text_parser = ArgumentParser(
122
125
  )
123
126
 
124
127
  extract_text_parser.add_argument('file_or_dir', nargs='+', metavar='FILE_OR_DIR')
128
+ extract_text_parser.add_argument('--debug', action='store_true', help='turn on debug level logging')
125
129
 
126
130
  extract_text_parser.add_argument('--page-range', '-r',
127
131
  type=page_range_validator,
@@ -151,4 +155,10 @@ def parse_text_extraction_args() -> Namespace:
151
155
  log.error(f"--page-range can only be specified for a single PDF")
152
156
  sys.exit(-1)
153
157
 
158
+ _set_log_level(args)
154
159
  return args
160
+
161
+
162
+ def _set_log_level(args: Namespace):
163
+ if args.debug:
164
+ log.setLevel(logging.DEBUG)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pdfalyzer
3
- Version: 1.17.2
3
+ Version: 1.17.3
4
4
  Summary: Analyze PDFs with colors (and YARA). Visualize a PDF's inner tree-like data structure, check it against a library of YARA rules, force decodes of suspicious font binaries, and more.
5
5
  Home-page: https://github.com/michelcrypt4d4mus/pdfalyzer
6
6
  License: GPL-3.0-or-later
@@ -1,5 +1,5 @@
1
1
  .pdfalyzer.example,sha256=sh_qkUBw4hfJia_Dx2wB-fsqJInhx2sSgA7WJz3MHYo,3917
2
- CHANGELOG.md,sha256=Zzq920SR4HeZjCDlqqVoLCPrc1hd5rqJQxih5p3aK1I,13250
2
+ CHANGELOG.md,sha256=ZFP4uDoiYT-kNa7XJuyNKhIjcvY5DU4CeMSGn0braPU,13301
3
3
  LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
4
4
  pdfalyzer/__init__.py,sha256=2Gikt_-OSXZqeQij4wSwb65g7jycVAupjeFmXBf51lo,6159
5
5
  pdfalyzer/__main__.py,sha256=Ko_AoAyYMLIe_cmhiUSl6twheLZrGyT8aOSJ2CP7EZY,43
@@ -7,7 +7,7 @@ pdfalyzer/binary/binary_scanner.py,sha256=gEHHdQ3lKe1P1441fk2OLO8GxJF7FxF8Tq04El
7
7
  pdfalyzer/config.py,sha256=RBtp3Q6IvOW922rcanB4mVceJEM0BEjNybc6_vC7efY,2122
8
8
  pdfalyzer/decorators/document_model_printer.py,sha256=2tjJItZltukmOD2wjGvl2IsBM7Gug59wMHGLpzGDbV0,2682
9
9
  pdfalyzer/decorators/indeterminate_node.py,sha256=QLJr-nGKih8gPZcIqxLU028OwWWD5VjNHYMUjniwT_k,6586
10
- pdfalyzer/decorators/pdf_file.py,sha256=KstGLrBHGio867l-ieVWR_Sps9Yy5z29Q0jBun9g68o,10746
10
+ pdfalyzer/decorators/pdf_file.py,sha256=Az3TL_Ttj_pDOHoHsiwpNlrCckCgKTp0VuGevJIi_5c,10481
11
11
  pdfalyzer/decorators/pdf_object_properties.py,sha256=Il3RObxQ4XUf0Ei-nd4tjJO0LeaxC6u7yFa3cQs_jVY,5485
12
12
  pdfalyzer/decorators/pdf_tree_node.py,sha256=4LReGJUtG8iEcLUQD1jW-yp3xPWsHrC-3Anbkt7XZ3A,11134
13
13
  pdfalyzer/decorators/pdf_tree_verifier.py,sha256=2hVe9APsAWQZ7ra8AGndHQnGWmmxmb3ZwfJHZuLvsvc,4714
@@ -36,7 +36,7 @@ pdfalyzer/pdf_object_relationship.py,sha256=tOJTp73m82oNZJB7NxvTLv167kqthH8PRbVn
36
36
  pdfalyzer/pdfalyzer.py,sha256=T5U8MZRlL0Kn-GJVqfIIoL7eBUdQeteu50VhQ-IoYh0,11214
37
37
  pdfalyzer/util/adobe_strings.py,sha256=eF4K1RhhR_qgMBT58MzCxWkqQj17OWLCNmG3SjZ9BUs,5045
38
38
  pdfalyzer/util/argument_parser.py,sha256=9ixQMEZz00IPK8xRxuS7DMrQgXIrqhB2ve5W8XTZ1S8,9732
39
- pdfalyzer/util/cli_tools_argument_parser.py,sha256=8bW0B4UXXkwuxNwDRe9MyXucTFm0pZRyOq98CO8D_Hs,5925
39
+ pdfalyzer/util/cli_tools_argument_parser.py,sha256=RqK_5AWC7qm9Zy7pvDb-J1WSEGBkIyxzNDcFJwSmuX4,6285
40
40
  pdfalyzer/util/debugging.py,sha256=hjYGxptJmal9TTaAUkkoo0oNu2tdx6ZYSyC0WjvzHh0,156
41
41
  pdfalyzer/util/exceptions.py,sha256=XLFFTdx1n6i_VCmvuzvIOCa-djJvGEitfo9lhy3zq0k,98
42
42
  pdfalyzer/util/page_range.py,sha256=NMNh3_TojxTxBIpvUYK1AmvID_m8qOP6AihZrLWZF2I,1652
@@ -47,8 +47,8 @@ pdfalyzer/yara_rules/__init.py__,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
47
47
  pdfalyzer/yara_rules/didier_stevens.yara,sha256=4XhqafU09xzYUP7LCygHHBXOpAXUblJf6Tkn37MUy0w,7253
48
48
  pdfalyzer/yara_rules/lprat.static_file_analysis.yara,sha256=i0CwRH8pBx_QshKFTQtr1CP5n378EZelsF2FxMY2y5A,21859
49
49
  pdfalyzer/yara_rules/pdf_malware.yara,sha256=jDqSTP5BQSi2I_1xZiFZdy68I4oVWDat2j08-qdfbto,91063
50
- pdfalyzer-1.17.2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
51
- pdfalyzer-1.17.2.dist-info/METADATA,sha256=y8x6ka9yoCPuU98_oLBzaNK4wXBWXy_2NLA7jYp4l9U,27294
52
- pdfalyzer-1.17.2.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
53
- pdfalyzer-1.17.2.dist-info/entry_points.txt,sha256=5ve7Ydx0p33ZuQWol6wIFAPPUgQrEQoJkOy06mD5t9Y,237
54
- pdfalyzer-1.17.2.dist-info/RECORD,,
50
+ pdfalyzer-1.17.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
51
+ pdfalyzer-1.17.3.dist-info/METADATA,sha256=MczhorkJI7ozznrHf72k7a0QELDinDNHhex4ur8kSr8,27294
52
+ pdfalyzer-1.17.3.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
53
+ pdfalyzer-1.17.3.dist-info/entry_points.txt,sha256=5ve7Ydx0p33ZuQWol6wIFAPPUgQrEQoJkOy06mD5t9Y,237
54
+ pdfalyzer-1.17.3.dist-info/RECORD,,