Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Wit, Allard de
csvtools
Commits
d8c782f1
Commit
d8c782f1
authored
Jan 27, 2022
by
Wit, Allard de
Browse files
Added a commandline to csv2db
parent
cbecf7f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
d8c782f1
.idea/
csvtools/__pycache__/
csvtools/cmd.py
0 → 100644
View file @
d8c782f1
import
click
from
.csv2db
import
process_csv
@
click
.
group
(
help
=
"With csvtools you can operate on CSV files"
)
def
cli
():
pass
@
click
.
command
(
"csv2db"
)
@
click
.
argument
(
"csv_fname"
,
type
=
click
.
Path
(
exists
=
True
))
@
click
.
argument
(
"sqlite_fname"
,
type
=
click
.
Path
())
def
cmd_csv2db
(
csv_fname
,
sqlite_fname
):
process_csv
(
csv_fname
,
sqlite_fname
)
def
main
():
cli
.
add_command
(
cmd_csv2db
)
cli
()
if
__name__
==
"__main__"
:
main
()
\ No newline at end of file
Write
Preview
Supports
Markdown
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