Skip to content

Commit

Permalink
cli docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leliel12 committed Apr 1, 2020
1 parent 6fae8fb commit cdfa04c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arcovid19.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# =============================================================================

import os
import sys
import datetime as dt

import logging
Expand Down Expand Up @@ -593,8 +594,9 @@ def _load_cases(*, url=CASES_URL, nocached=False, out=None):
url: str
The url for the excel table to parse. Default is ivco19 team table.
out: PATH
The output path to the CSV file
out: PATH (default=stdout)
The output path to the CSV file. If it's not provided the
data is printed in the stdout.
nocached:
If you want to ignore the local cache or retrieve a new value.
Expand All @@ -604,7 +606,7 @@ def _load_cases(*, url=CASES_URL, nocached=False, out=None):
if out is not None:
cases.to_csv(out)
else:
print(cases)
cases.to_csv(sys.stdout)
run(_load_cases)


Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Contents:
:maxdepth: 2

install/install.rst
install/cli.rst
tutorial/tutorial.rst
api/modules.rst

Expand Down
29 changes: 29 additions & 0 deletions docs/source/install/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Command line interface (CLI)
============================

After install arcovid19 you also have a command line app to download the
data as csv.

.. code-block:: console
$ arcovid19 --help
Usage: arcovid19 [OPTIONS]
Retrieve and store the database as an as CSV file.
Options:
--url=STR str The url for the excel table to parse. Default is ivco19 team table. (default: https://github.com/ivco19/libs/raw/master/databases/cases.xlsx)
--out=STR PATH (default=stdout) The output path to the CSV file. If it's not provided the data is printed in the stdout.
--nocached If you want to ignore the local cache or retrieve a new value.
Other actions:
-h, --help Show the help
1 change: 1 addition & 0 deletions docs/source/install/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ This will create a directory libs in your current directory.




0 comments on commit cdfa04c

Please sign in to comment.