Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
54f31b65
Commit
54f31b65
authored
Jun 04, 2024
by
赵小蒙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update cli
parent
4ce15c44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
magicpdf.py
magic_pdf/cli/magicpdf.py
+3
-5
No files found.
magic_pdf/cli/magicpdf.py
View file @
54f31b65
...
@@ -98,12 +98,13 @@ def _do_parse(pdf_file_name, pdf_bytes, model_list, parse_method, image_writer,
...
@@ -98,12 +98,13 @@ def _do_parse(pdf_file_name, pdf_bytes, model_list, parse_method, image_writer,
@
click
.
group
()
@
click
.
group
()
@
click
.
version_option
(
__version__
,
"--version"
,
"-v"
,
help
=
"显示版本信息"
)
@
click
.
help_option
(
"--help"
,
"-h"
,
help
=
"显示帮助信息"
)
def
cli
():
def
cli
():
pass
pass
@
cli
.
command
()
@
cli
.
command
()
@
click
.
version_option
(
__version__
,
"--version"
,
"-v"
,
help
=
"显示版本信息"
)
@
click
.
option
(
"--json"
,
type
=
str
,
help
=
"输入一个S3路径"
)
@
click
.
option
(
"--json"
,
type
=
str
,
help
=
"输入一个S3路径"
)
@
click
.
option
(
@
click
.
option
(
"--method"
,
"--method"
,
...
@@ -143,7 +144,7 @@ def json_command(json, method):
...
@@ -143,7 +144,7 @@ def json_command(json, method):
pdf_file_name
=
Path
(
s3_file_path
)
.
stem
pdf_file_name
=
Path
(
s3_file_path
)
.
stem
pdf_data
=
read_s3_path
(
s3_file_path
)
pdf_data
=
read_s3_path
(
s3_file_path
)
local_image_dir
,
local_md_dir
=
prepare_env
(
pdf_file_name
,
method
)
local_image_dir
,
local_md_dir
=
prepare_env
(
pdf_file_name
,
method
)
local_image_rw
,
local_md_rw
=
DiskReaderWriter
(
local_image_dir
),
DiskReaderWriter
(
local_image_rw
,
local_md_rw
=
DiskReaderWriter
(
local_image_dir
),
DiskReaderWriter
(
local_md_dir
local_md_dir
)
)
...
@@ -161,7 +162,6 @@ def json_command(json, method):
...
@@ -161,7 +162,6 @@ def json_command(json, method):
@
cli
.
command
()
@
cli
.
command
()
@
click
.
version_option
(
__version__
,
"--version"
,
"-v"
,
help
=
"显示版本信息"
)
@
click
.
option
(
"--local_json"
,
type
=
str
,
help
=
"输入一个本地jsonl路径"
)
@
click
.
option
(
"--local_json"
,
type
=
str
,
help
=
"输入一个本地jsonl路径"
)
@
click
.
option
(
@
click
.
option
(
"--method"
,
"--method"
,
...
@@ -218,7 +218,6 @@ def local_json_command(local_json, method):
...
@@ -218,7 +218,6 @@ def local_json_command(local_json, method):
@
cli
.
command
()
@
cli
.
command
()
@
click
.
version_option
(
__version__
,
"--version"
,
"-v"
,
help
=
"显示版本信息"
)
@
click
.
option
(
@
click
.
option
(
"--pdf"
,
type
=
click
.
Path
(
exists
=
True
),
required
=
True
,
help
=
"PDF文件的路径"
"--pdf"
,
type
=
click
.
Path
(
exists
=
True
),
required
=
True
,
help
=
"PDF文件的路径"
)
)
...
@@ -260,7 +259,6 @@ def pdf_command(pdf, model, method):
...
@@ -260,7 +259,6 @@ def pdf_command(pdf, model, method):
)
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
"""
"""
python magic_pdf/cli/magicpdf.py json-command --json s3://llm-pdf-text/pdf_ebook_and_paper/manual/v001/part-660407a28beb-000002.jsonl?bytes=0,63551
python magic_pdf/cli/magicpdf.py json-command --json s3://llm-pdf-text/pdf_ebook_and_paper/manual/v001/part-660407a28beb-000002.jsonl?bytes=0,63551
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment