aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-05-17 10:00:20 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-05-17 10:00:20 -0300
commit7873814e1433b64eef674a993359a58cee52f131 (patch)
tree6bc8cc6f13c999d9c65fc59537844a1c805cfbf1
parent94467dd41a26b8f9a03ce6f195ca3f71bfe7e13a (diff)
downloadckandumper-7873814e1433b64eef674a993359a58cee52f131.tar.gz
ckandumper-7873814e1433b64eef674a993359a58cee52f131.tar.bz2
Move examples into help option
-rw-r--r--README.md5
-rwxr-xr-xckandumper7
2 files changed, 8 insertions, 4 deletions
diff --git a/README.md b/README.md
index 4639f51..c549556 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,6 @@ Works on python 3.7 with the following dependencies met:
apt install wget python3-tqdm
-## Examples
+## Usage
- ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://opendata.swiss/en/ switzerland/
- ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://open.canada.ca/data/en/ canada/
+ ckandumper --help
diff --git a/ckandumper b/ckandumper
index a371220..400fc61 100755
--- a/ckandumper
+++ b/ckandumper
@@ -321,7 +321,12 @@ class CkanDumper:
if __name__ == "__main__":
# Parse CLI
- parser = argparse.ArgumentParser(description='Dump CKAN metadata and datasets.')
+ examples = """ Examples:
+
+ ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://open.canada.ca/data/en/ canada/
+ ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://opendata.swiss/en/ switzerland/
+ """
+ parser = argparse.ArgumentParser(description='Dump CKAN metadata and datasets.', epilog=examples, formatter_class=argparse.RawDescriptionHelpFormatter,)
parser.add_argument('url', nargs='+', help='CKAN instance URL')
parser.add_argument('dest', nargs='+', help='Destination folder')
parser.add_argument('--limit-rate', help='Limit the download speed to amount bytes per second, per download')