Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nic
gridsource
Commits
2b93891f
Commit
2b93891f
authored
Jan 14, 2021
by
Nic
Browse files
improve XLSX engine selection from CLI
parent
fb36262a
Changes
1
Hide whitespace changes
Inline
Side-by-side
gridsource/cli.py
View file @
2b93891f
...
...
@@ -16,6 +16,7 @@ import sys
import
pandas
as
pd
from
gridsource
import
Data
,
IOData
,
ValidData
,
__version__
from
gridsource.io
import
DEFAULT_EXCEL_ENGINE
def
version
(
args
=
None
):
...
...
@@ -92,7 +93,7 @@ def parse_args(args):
"""Console script"""
# https://docs.python.org/3/library/argparse.html
# https://docs.python.org/3/howto/argparse.html
parser
=
argparse
.
ArgumentParser
(
"
easy CLI for app_nam
e"
)
parser
=
argparse
.
ArgumentParser
(
"
gsourc
e"
)
parser
.
add_argument
(
"-v"
,
"--verbose"
,
action
=
"store_true"
,
help
=
"Show Version and exit"
)
...
...
@@ -110,9 +111,9 @@ def parse_args(args):
"-e"
,
"--engine"
,
type
=
str
,
default
=
"xlrd"
,
default
=
DEFAULT_EXCEL_ENGINE
,
choices
=
(
"xlrd"
,
"openpyxl"
),
help
=
"
pandas
XLSX reader engine
"
,
help
=
"XLSX reader engine
(default '%s')"
%
DEFAULT_EXCEL_ENGINE
,
)
parser_export
.
set_defaults
(
process
=
export
)
# =========================================================================
...
...
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