Skip to content

Commit

Permalink
#147 add total.py and base command funcitonality
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Jun 22, 2024
1 parent 11f4f94 commit 3736222
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/scribe_data/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@
from .list import list_wrapper
from .query import query_data

LIST_DESCRIPTION = "List languages and word types that Scribe-Data can be used for."
LIST_DESCRIPTION = "List languages, word types and combinations of each that Scribe-Data can be used for."
QUERY_DESCRIPTION = "Query data from Wikidata for given languages and word types."
TOTAL_DESCRIPTION = (
"Check Wikidata for the available data for given languages and word types"
)
CONVERT_DESCRIPTION = "Convert data returned by Scribe-Data to different file types."
CLI_EPILOG = "Visit the codebase at https://github.com/scribe-org/Scribe-Data and documentation at https://scribe-data.readthedocs.io/en/latest/ to learn more!"


def main() -> None:
# MARK: CLI Base

parser = argparse.ArgumentParser(
prog="Scribe-Data",
description="The Scribe-Data CLI is a tool to query language data from Wikidata and other sources.",
Expand Down Expand Up @@ -104,6 +109,23 @@ def main() -> None:
help="Whether to overwrite existing files (default: False).",
)

# MARK: Total

total_parser = subparsers.add_parser(
"total",
aliases=["t"],
help=TOTAL_DESCRIPTION,
description=TOTAL_DESCRIPTION,
epilog=CLI_EPILOG,
)
total_parser._actions[0].help = "Show this help message and exit."
total_parser.add_argument(
"-lang", "--language", type=str, help="The language(s) to check totals for."
)
total_parser.add_argument(
"-wt", "--word-type", type=str, help="The word type(s) to check totals for."
)

# MARK: Convert

convert_parser = subparsers.add_parser(
Expand Down Expand Up @@ -152,6 +174,9 @@ def main() -> None:
args.output_type,
)

elif args.command in ["total", "t"]:
return

elif args.command in ["convert", "c"]:
return

Expand Down
21 changes: 21 additions & 0 deletions src/scribe_data/cli/total.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Functions to check the total language data available on Wikidata.
.. raw:: html
<!--
* Copyright (C) 2024 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
"""

0 comments on commit 3736222

Please sign in to comment.