Skip to content

Commit

Permalink
Merge pull request #500 from axif0/bug_inter
Browse files Browse the repository at this point in the history
feat interactive v2.0
  • Loading branch information
andrewtavis authored Nov 8, 2024
2 parents 7c78c56 + 8c598c8 commit 647d1d9
Show file tree
Hide file tree
Showing 7 changed files with 611 additions and 106 deletions.
76 changes: 63 additions & 13 deletions docs/source/scribe_data/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,31 @@ Options:
- ``-ot, --output-type {json,csv,tsv}``: The output file type.
- ``-ope, --outputs-per-entry OUTPUTS_PER_ENTRY``: How many outputs should be generated per data entry.
- ``-o, --overwrite``: Whether to overwrite existing files (default: False).
- ``-a, --all ALL``: Get all languages and data types.
- ``-a, --all``: Get all languages and data types. Can be combined with `-dt` to get all languages for a specific data type, or with `-lang` to get all data types for a specific language.
- ``-i, --interactive``: Run in interactive mode.

Example:
Examples:

.. code-block:: bash
$ scribe-data get --all
Getting data for all languages and all data types...
.. code-block:: bash
$ scribe-data get --all -dt nouns
Getting all nouns for all languages...
.. code-block:: bash
$ scribe-data get --all -lang English
Getting all data types for English...
.. code-block:: bash
$ scribe-data get -l English --data-type verbs -od ~/path/for/output
Getting and formatting English verbs
Data updated: 100%|████████████████████████| 1/1 [00:XY<00:00, XY.Zs/process]
Behavior and Output:
^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -180,7 +197,7 @@ Behavior and Output:
.. code-block:: text
Getting and formatting English verbs
Data updated: 100%|████████████████████████| 1/1 [00:29<00:00, 29.73s/process]
Data updated: 100%|████████████████████████| 1/1 [00:XY<00:00, XY.Zs/process]
4. If no data is found, you'll see a warning:

Expand Down Expand Up @@ -242,30 +259,63 @@ Usage:
Options:
^^^^^^^^

- ``-lang, --language LANGUAGE``: The language(s) to check totals for.
- ``-lang, --language LANGUAGE``: The language(s) to check totals for. Can be a language name or QID.
- ``-dt, --data-type DATA_TYPE``: The data type(s) to check totals for.
- ``-a, --all ALL``: Get totals for all languages and data types.
- ``-a, --all``: Get totals for all languages and data types.

Examples:

.. code-block:: text
$scribe-data total -dt nouns # verbs, adjectives, etc
Data type: nouns
Total number of lexemes: 123456
$ scribe-data total --all
Total lexemes for all languages and data types:
==============================================
Language Data Type Total Lexemes
==============================================
English nouns 123,456
verbs 234,567
...
.. code-block:: text
$scribe-data total -lang English
Language: English
Total number of lexemes: 123456
$ scribe-data total --language English
Returning total counts for English data types...
Language Data Type Total Wikidata Lexemes
================================================================
English adjectives 12,345
adverbs 23,456
nouns 34,567
...
.. code-block:: text
$scribe-data total -lang English -dt nouns # verbs, adjectives, etc
$ scribe-data total --language Q1860
Wikidata QID Q1860 passed. Checking all data types.
Language Data Type Total Wikidata Lexemes
================================================================
Q1860 adjectives 12,345
adverbs 23,456
articles 30
conjunctions 40
nouns 56,789
personal pronouns 60
...
.. code-block:: text
$ scribe-data total --language English -dt nouns
Language: English
Data type: nouns
Total number of lexemes: 12345
Total number of lexemes: 12,345
.. code-block:: text
$ scribe-data total --language Q1860 -dt verbs
Language: Q1860
Data type: verbs
Total number of lexemes: 23,456
Convert Command
~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion src/scribe_data/check/check_pyicu.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_python_version_and_architecture():

def fetch_wheel_releases():
"""
Fetch the release data for PyICU from GitHub.
Fetch the release data for PyICU from GitHub with error handling for rate limits.
Returns
-------
Expand Down
Loading

0 comments on commit 647d1d9

Please sign in to comment.