From 9ce0e76a3778e14f7c735777eefbc88306d1477f Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sat, 24 Feb 2024 03:36:52 +0100 Subject: [PATCH] #57 fix doc import errors and organize default index --- docs/source/index.rst | 19 ++++++++++----- docs/source/notes.rst | 4 ++-- docs/source/{ => scribe_data}/checkquery.rst | 0 .../extract_transform/index.rst | 0 docs/source/scribe_data/index.rst | 10 ++++++++ docs/source/{ => scribe_data}/load/index.rst | 0 docs/source/{ => scribe_data}/utils.rst | 0 src/scribe_data/checkquery.py | 24 +++++++++---------- src/scribe_data/utils.py | 8 +++---- 9 files changed, 41 insertions(+), 24 deletions(-) rename docs/source/{ => scribe_data}/checkquery.rst (100%) rename docs/source/{ => scribe_data}/extract_transform/index.rst (100%) create mode 100644 docs/source/scribe_data/index.rst rename docs/source/{ => scribe_data}/load/index.rst (100%) rename docs/source/{ => scribe_data}/utils.rst (100%) diff --git a/docs/source/index.rst b/docs/source/index.rst index 8a72aabcd..15c51f5fb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -41,7 +41,8 @@ Wikidata and Wikipedia language data extraction Installation ------------- +============ + .. code-block:: shell pip install scribe-data @@ -56,14 +57,20 @@ Installation import scribe_data +Contents +======== + +.. toctree:: + :maxdepth: 2 + + scribe_data/index + +Contributing +============ + .. toctree:: :maxdepth: 2 - :caption: Contents - extract_transform/index - load/index - checkquery - utils notes Project Indices diff --git a/docs/source/notes.rst b/docs/source/notes.rst index 199226b01..4ca2eb081 100644 --- a/docs/source/notes.rst +++ b/docs/source/notes.rst @@ -1,9 +1,9 @@ -.. mdinclude:: ../../.github/docs/CONTRIBUTING_NO_BACK_LINKS.md - License ======= .. literalinclude:: ../../LICENSE.txt :language: text +.. mdinclude:: ../../.github/docs/CONTRIBUTING_NO_BACK_LINKS.md + .. mdinclude:: ../../CHANGELOG.md diff --git a/docs/source/checkquery.rst b/docs/source/scribe_data/checkquery.rst similarity index 100% rename from docs/source/checkquery.rst rename to docs/source/scribe_data/checkquery.rst diff --git a/docs/source/extract_transform/index.rst b/docs/source/scribe_data/extract_transform/index.rst similarity index 100% rename from docs/source/extract_transform/index.rst rename to docs/source/scribe_data/extract_transform/index.rst diff --git a/docs/source/scribe_data/index.rst b/docs/source/scribe_data/index.rst new file mode 100644 index 000000000..9b33212f2 --- /dev/null +++ b/docs/source/scribe_data/index.rst @@ -0,0 +1,10 @@ +scribe_data +=========== + +.. toctree:: + :maxdepth: 1 + + extract_transform/index + load/index + checkquery + utils diff --git a/docs/source/load/index.rst b/docs/source/scribe_data/load/index.rst similarity index 100% rename from docs/source/load/index.rst rename to docs/source/scribe_data/load/index.rst diff --git a/docs/source/utils.rst b/docs/source/scribe_data/utils.rst similarity index 100% rename from docs/source/utils.rst rename to docs/source/scribe_data/utils.rst diff --git a/src/scribe_data/checkquery.py b/src/scribe_data/checkquery.py index d6e4a500c..71ab44109 100755 --- a/src/scribe_data/checkquery.py +++ b/src/scribe_data/checkquery.py @@ -296,13 +296,13 @@ def check_positive_int(value: str, err_msg: str) -> int: err_msg : str Used when value fails validation. - Raises - ------ - argparse.ArgumentTypeError - Returns ------- int : the validated number. + + Raises + ------ + argparse.ArgumentTypeError """ try: number = int(value) @@ -323,13 +323,13 @@ def check_limit(limit: str) -> int: limit : str The LIMIT to be validated. - Raises - ------ - argparse.ArgumentTypeError - Returns ------- int : the validated LIMIT. + + Raises + ------ + argparse.ArgumentTypeError """ return check_positive_int(limit, "LIMIT must be an integer of value 1 or greater.") @@ -343,13 +343,13 @@ def check_timeout(timeout: str) -> int: timeout : str The timeout to be validated. - Raises - ------ - argparse.ArgumentTypeError - Returns ------- int : the validated timeout. + + Raises + ------ + argparse.ArgumentTypeError """ return check_positive_int( timeout, "timeout must be an integer of value 1 or greater." diff --git a/src/scribe_data/utils.py b/src/scribe_data/utils.py index a8b4e934e..c6b894303 100644 --- a/src/scribe_data/utils.py +++ b/src/scribe_data/utils.py @@ -102,13 +102,13 @@ def _find(source_key: str, source_value: str, target_key: str, error_msg: str): error_msg : str The message displayed when a value cannot be found. - Raises - ------ - ValueError : when a source_value is not supported. - Returns ------- The 'target' value given the passed arguments. + + Raises + ------ + ValueError : when a source_value is not supported. """ norm_source_value = source_value.lower()