You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/visarchpy/cli/layout.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
importjson
8
8
fromvisarchpy.utilsimportcreate_output_dir
9
9
importshutil
10
-
importvisarchpy.cli.settingsassettings
10
+
importvisarchpy.cli.settingsasdefault_settings
11
11
12
12
13
13
app=typer.Typer(help="Extract images from PDF files using layout \
@@ -20,12 +20,12 @@
20
20
deffrom_file(
21
21
pdf_file: str=typer.Argument(help="Path to directory containing PDF files."),
22
22
output_directory: str=typer.Argument(help="Path to directory where results will be saved."),
23
-
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings will be used. Use: [COMMAND] settings, to see current settings.")] =None,
23
+
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings are used. Use: [COMMAND] settings, to see current settings.")] =None,
24
24
mods: Annotated[str, typer.Option(help="Path to MODS file. If None, metadata extraction will be skiped.")] =None
25
25
) ->None:
26
26
27
27
ifsettingsisNone:
28
-
settings=settings.init()
28
+
settings=default_settings.init()
29
29
else:
30
30
withopen(settings, "r") asf:
31
31
settings=json.load(f)
@@ -54,13 +54,13 @@ def from_file(
54
54
deffrom_dir(
55
55
data_directory: str=typer.Argument(help="Path to directory containing PDF files."),
56
56
output_directory: str=typer.Argument(help="Path to directory where results will be saved."),
57
-
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings will be used. Use: [COMMAND] settings, to see current settings.")] =None,
57
+
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings are used. Use: [COMMAND] settings, to see current settings.")] =None,
58
58
mods: Annotated[str, typer.Option(help="Path to MODS file. If None, metadata extraction will be skiped.")] =None,
59
59
tmp: Annotated[str, typer.Option(help="If provided, PDF files in the data directory will be copied to this directory.")
60
60
] =None) ->None:
61
61
62
62
ifsettingsisNone:
63
-
settings=settings.init()
63
+
settings=default_settings.init()
64
64
else:
65
65
withopen(settings, "r") asf:
66
66
settings=json.load(f)
@@ -76,7 +76,7 @@ def from_dir(
76
76
@app.command(help="Show default settings for the pipeline.")
Copy file name to clipboardExpand all lines: src/visarchpy/cli/layout_ocr.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
importjson
8
8
fromvisarchpy.utilsimportcreate_output_dir
9
9
importshutil
10
-
importvisarchpy.cli.settingsassettings
10
+
importvisarchpy.cli.settingsasdefault_settings
11
11
12
12
app=typer.Typer(help="Extract images from PDF files using layout and \
13
13
OCR analysis.",
@@ -19,12 +19,12 @@
19
19
deffrom_file(
20
20
pdf_file: str=typer.Argument(help="Path to directory containing PDF files."),
21
21
output_directory: str=typer.Argument(help="Path to directory where results will be saved."),
22
-
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings will be used. Use: [COMMAND] settings, to see current settings.")] =None,
22
+
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings are used. Use: [COMMAND] settings, to see current settings.")] =None,
23
23
mods: Annotated[str, typer.Option(help="Path to MODS file. If None, metadata extraction will be skiped.")] =None
24
24
) ->None:
25
25
26
26
ifsettingsisNone:
27
-
settings=settings.init()
27
+
settings=default_settings.init()
28
28
else:
29
29
withopen(settings, "r") asf:
30
30
settings=json.load(f)
@@ -53,13 +53,13 @@ def from_file(
53
53
deffrom_dir(
54
54
data_directory: str=typer.Argument(help="Path to directory containing PDF files."),
55
55
output_directory: str=typer.Argument(help="Path to directory where results will be saved."),
56
-
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings will be used. Use: [COMMAND] settings, to see current settings.")] =None,
56
+
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings are used. Use: [COMMAND] settings, to see current settings.")] =None,
57
57
mods: Annotated[str, typer.Option(help="Path to MODS file. If None, metadata extraction will be skiped.")] =None,
58
58
tmp: Annotated[str, typer.Option(help="If provided, PDF files in the data directory will be copied to this directory.")
59
59
] =None) ->None:
60
60
61
61
ifsettingsisNone:
62
-
settings=settings.init()
62
+
settings=default_settings.init()
63
63
else:
64
64
withopen(settings, "r") asf:
65
65
settings=json.load(f)
@@ -75,21 +75,21 @@ def from_dir(
75
75
@app.command(help="Show default settings for the pipeline.")
76
76
defsettings() ->None:
77
77
"""Show default settings for the pipeline."""
78
-
typer.echo(default_settings)
78
+
typer.echo(default_settings.init())
79
79
80
80
81
81
@app.command(help="batch processing for TU Delft's dataset.")
82
82
defbatch(entry_range: str=typer.Argument(help="Range of entries to process, e.g.: 1-10."),
83
83
data_directory: str=typer.Argument(help="path to directory containing MODS and PDF files."),
84
84
output_directory: str=typer.Argument(help="path to directory where results will be saved."),
85
-
settings: Annotated[str, typer.Option(help="path to pipeline JSON setting file. If None default settings will be used. Use: [COMMAND] settings, to see current settings.")] =None,
85
+
settings: Annotated[str, typer.Option(help="path to pipeline JSON setting file. If None default settings are used. Use: [COMMAND] settings, to see current settings.")] =None,
86
86
tmp: Annotated[str, typer.Option(help="If provided, PDF files in the data directory will be copied to this directory.")
87
87
] =None) ->None:
88
88
"""Extracts metadata from MODS files and images from PDF files
Copy file name to clipboardExpand all lines: src/visarchpy/cli/ocr.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
importjson
8
8
fromvisarchpy.utilsimportcreate_output_dir
9
9
importshutil
10
-
importvisarchpy.cli.settingsassettings
10
+
importvisarchpy.cli.settingsasdefault_settings
11
11
12
12
13
13
app=typer.Typer(help="Extract images from PDF files using OCR \
@@ -20,12 +20,12 @@
20
20
deffrom_file(
21
21
pdf_file: str=typer.Argument(help="Path to directory containing PDF files."),
22
22
output_directory: str=typer.Argument(help="Path to directory where results will be saved."),
23
-
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings will be used. Use: [COMMAND] settings, to see current settings.")] =None,
23
+
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings are used. Use: [COMMAND] settings, to see current settings.")] =None,
24
24
mods: Annotated[str, typer.Option(help="Path to MODS file. If None, metadata extraction will be skiped.")] =None
25
25
) ->None:
26
26
27
27
ifsettingsisNone:
28
-
settings=settings.init()
28
+
settings=default_settings.init()
29
29
else:
30
30
withopen(settings, "r") asf:
31
31
settings=json.load(f)
@@ -54,13 +54,13 @@ def from_file(
54
54
deffrom_dir(
55
55
data_directory: str=typer.Argument(help="Path to directory containing PDF files."),
56
56
output_directory: str=typer.Argument(help="Path to directory where results will be saved."),
57
-
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings will be used. Use: [COMMAND] settings, to see current settings.")] =None,
57
+
settings: Annotated[str, typer.Option(help="Path to pipeline JSON setting file. If None default settings are used. Use: [COMMAND] settings, to see current settings.")] =None,
58
58
mods: Annotated[str, typer.Option(help="Path to MODS file. If None, metadata extraction will be skiped.")] =None,
59
59
tmp: Annotated[str, typer.Option(help="If provided, PDF files in the data directory will be copied to this directory.")
60
60
] =None) ->None:
61
61
62
62
ifsettingsisNone:
63
-
settings=settings.init()
63
+
settings=default_settings.init()
64
64
else:
65
65
withopen(settings, "r") asf:
66
66
settings=json.load(f)
@@ -76,7 +76,7 @@ def from_dir(
76
76
@app.command(help="Show default settings for the pipeline.")
0 commit comments