From 5b5c8aa01ad48a0646f6a00344864acfeac70c30 Mon Sep 17 00:00:00 2001 From: goFrendiAsgard Date: Tue, 14 Nov 2023 09:01:01 +0700 Subject: [PATCH] update docs --- README.md | 116 ++++++++---------- docs/faq/does-zrb-has-a-scheduler.md | 6 +- docs/getting-started.md | 31 ++--- docs/tutorials/README.md | 5 +- .../accessing-task-using-web-interface.md | 5 + ...chedule.md => running-task-by-schedule.md} | 0 ...ly.md => running-task-programmatically.md} | 0 7 files changed, 72 insertions(+), 91 deletions(-) create mode 100644 docs/tutorials/accessing-task-using-web-interface.md rename docs/tutorials/{run-task-by-schedule.md => running-task-by-schedule.md} (100%) rename docs/tutorials/{run-task-programmatically.md => running-task-programmatically.md} (100%) diff --git a/README.md b/README.md index cb7cd41a..8a2119dc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![](https://raw.githubusercontent.com/state-alchemists/zrb/main/_images/zrb/android-chrome-192x192.png) -[๐Ÿซฐ Installation](#-installation) | [๐Ÿ“– Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md) | [๐Ÿ Getting Started](https://github.com/state-alchemists/zrb/blob/main/docs/getting-started.md) | [๐Ÿ’ƒ Oops, I did it Again](https://github.com/state-alchemists/zrb/blob/main/docs/oops-i-did-it-again/README.md) | [โ“ FAQ](https://github.com/state-alchemists/zrb/blob/main/docs/faq/README.md) +[๐Ÿซฐ Installation](https://github.com/state-alchemists/zrb/blob/main/README.md#-installation) | [๐Ÿ“– Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md) | [๐Ÿ Getting Started](https://github.com/state-alchemists/zrb/blob/main/docs/getting-started.md) | [๐Ÿ’ƒ Oops, I did it Again](https://github.com/state-alchemists/zrb/blob/main/docs/oops-i-did-it-again/README.md) | [โ“ FAQ](https://github.com/state-alchemists/zrb/blob/main/docs/faq/README.md) Zrb is a [CLI-based](https://en.wikipedia.org/wiki/Command-line_interface) automation [tool](https://en.wikipedia.org/wiki/Programming_tool) and [low-code](https://en.wikipedia.org/wiki/Low-code_development_platform) platform. Once installed, Zrb will help you automate day-to-day tasks, generate projects and applications, and even deploy your applications to Kubernetes with a few commands. @@ -21,19 +21,11 @@ Let's say you want to describe the statistics property of any public CSV. To do - Show statistics properties of the CSV dataset using pandas (right after the two first tasks are completed). ``` - ๐Ÿผ - โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” - โ”‚ โ”‚ - โ”‚ Install Pandas โ”œโ”€โ” ๐Ÿ“Š - โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” - โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ–บโ”‚ โ”‚ - โ”‚ Show Statistics โ”‚ - โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ–บโ”‚ โ”‚ - โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โ”‚ Download Dataset โ”œโ”€โ”˜ - โ”‚ โ”‚ - โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โฌ‡๏ธ + ๐Ÿผ +Install Pandas โ”€โ”€โ”€โ”€โ”€โ” ๐Ÿ“Š + โ”œโ”€โ”€โ–บ Show Statistics +Download Datasets โ”€โ”€โ”˜ + โฌ‡๏ธ ``` To do this, you can create a file named `zrb_init.py` and define the tasks as follows: @@ -42,17 +34,18 @@ To do this, you can create a file named `zrb_init.py` and define the tasks as fo # File name: zrb_init.py from zrb import runner, CmdTask, python_task, StrInput -# ๐Ÿผ Define a task to install pandas +# ๐Ÿผ Define a task named `install-pandas` to install pandas install_pandas = CmdTask( name='install-pandas', cmd='pip install pandas' ) -# โฌ‡๏ธ Define a task to download dataset +# โฌ‡๏ธ Define a task named `download-dataset` to download dataset download_dataset = CmdTask( name='download-dataset', inputs=[ - # Allow user to put the CSV dataset URL. + # Define an input named `url` and set it's default value. + # You can access url's input value by using Jinja template: `{{ input.url }}` StrInput( name='url', default='https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv' @@ -61,41 +54,42 @@ download_dataset = CmdTask( cmd='wget -O dataset.csv {{input.url}}' ) -# ๐Ÿ“Š Define a task to show the statistics properties of the dataset -show_stat = CmdTask( +# ๐Ÿ“Š Define a task named `show-stat` to show the statistics properties of the dataset +# We use `@python_task` decorator because this task is better written in Python +@python_task( name='show-stat', upstreams=[ - # Let the following tasks to be show_stat's upstream: + # Let `download-dataset` and `install-pandas` become `show-stat` upstream: download_dataset, install_pandas - ], - cmd='python -c "import pandas as pd; df=pd.read_csv(\'dataset.csv\'); print(df.describe())"' # noqa + ] ) +def show_stat(*args, **kwargs): + import pandas as pd + df = pd.read_csv('dataset.csv') + return df.describe() # Register show_stat, so that the task is accessible from the CLI (i.e., zrb show-stat) # WARNING: You should register the variable, not the name of the task runner.register(show_stat) ``` -> __๐Ÿ“ NOTE:__ In this example, we exclusively use `CmdTask` to execute CLI scripts. However, Zrb has many other task types, like `python_task`. You can rewrite `show_stat` task using `@python_task` decorator as follow: +> __๐Ÿ“ NOTE:__ It is possible to define `show_stat` as `CmdTask`: > > ```python -> # ๐Ÿ“Š Define a task to show the statistics properties of the dataset -> @python_task( +> # ๐Ÿ“Š Define a task named `show-stat` to show the statistics properties of the dataset +> show_stat = CmdTask( > name='show-stat', > upstreams=[ -> # Let the following tasks to be show_stat's upstream: +> # Let `download-dataset` and `install-pandas` become `show-stat` upstream: > download_dataset, > install_pandas -> ] +> ], +> cmd='python -c "import pandas as pd; df=pd.read_csv(\'dataset.csv\'); print(df.describe())"' > ) -> def show_stat(*args, **kwargs): -> import pandas as pd -> df = pd.read_csv('dataset.csv') -> return df.describe() > ``` > -> This will make more sense since `show_stat` is better written in Python. +> However, using `@python_task` is more make sense, since it makes your Python code more readable. Once you do so, you can invoke the task and get the output. @@ -105,43 +99,32 @@ zrb show-stat ``` Url [https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv]: -๐Ÿค– โ—‹ โ 36725 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข Run script: wget -O dataset.csv https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv -๐Ÿค– โ—‹ โ 36725 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข Working directory: /home/gofrendi/playground/myproject -๐Ÿค– โ—‹ โ 36725 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Run script: pip install pandas -๐Ÿค– โ—‹ โ 36725 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Working directory: /home/gofrendi/playground/myproject -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข --2023-11-11 16:15:54-- https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.108.133, ... -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. -๐Ÿค– โ—‹ โ 36748 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Requirement already satisfied: pandas in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (2.1.3) -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข HTTP request sent, awaiting response... 200 OK -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข Length: 4606 (4.5K) [text/plain] -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข Saving to: โ€˜dataset.csvโ€™ -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข 0K .... 100% 1.40M=0.003s -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข 2023-11-11 16:15:54 (1.40 MB/s) - โ€˜dataset.csvโ€™ saved [4606/4606] -๐Ÿค– โ–ณ โ 36746 โ†’ 1/3 ๐Ÿจ download-dataset โ€ข -๐Ÿค– โ—‹ โ 36748 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Requirement already satisfied: numpy<2,>=1.22.4 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (1.26.1) -๐Ÿค– โ—‹ โ 36748 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Requirement already satisfied: python-dateutil>=2.8.2 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2.8.2) -๐Ÿค– โ—‹ โ 36748 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Requirement already satisfied: pytz>=2020.1 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2023.3.post1) -๐Ÿค– โ—‹ โ 36748 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Requirement already satisfied: tzdata>=2022.1 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2023.3) -๐Ÿค– โ—‹ โ 36748 โ†’ 1/3 ๐Ÿป install-pandas โ€ข Requirement already satisfied: six>=1.5 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0) -๐Ÿค– โ—‹ โ 36725 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข Run script: python -c "import pandas as pd; df=pd.read_csv('dataset.csv'); print(df.describe())" -๐Ÿค– โ—‹ โ 36725 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข Working directory: /home/gofrendi/playground/myproject -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข sepal_length sepal_width petal_length petal_width -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข count 150.000000 150.000000 150.000000 150.000000 -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข mean 5.843333 3.054000 3.758667 1.198667 -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข std 0.828066 0.433594 1.764420 0.763161 -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข min 4.300000 2.000000 1.000000 0.100000 -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข 25% 5.100000 2.800000 1.600000 0.300000 -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข 50% 5.800000 3.000000 4.350000 1.300000 -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข 75% 6.400000 3.300000 5.100000 1.800000 -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข max 7.900000 4.400000 6.900000 2.500000 +๐Ÿค– โ—‹ โ—ท โ 43598 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Run script: pip install pandas +๐Ÿค– โ—‹ โ—ท โ 43598 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Working directory: /home/gofrendi/playground/my-project +๐Ÿค– โ—‹ โ—ท โ 43598 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Run script: wget -O dataset.csv https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv +๐Ÿค– โ—‹ โ—ท โ 43598 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Working directory: /home/gofrendi/playground/my-project +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข --2023-11-12 09:45:12-- https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.110.133, ... +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข HTTP request sent, awaiting response... 200 OK +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Length: 4606 (4.5K) [text/plain] +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข Saving to: โ€˜dataset.csvโ€™ +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข 0K .... 100% 1.39M=0.003s +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข 2023-11-12 09:45:12 (1.39 MB/s) - โ€˜dataset.csvโ€™ saved [4606/4606] +๐Ÿค– โ–ณ โ—ท โ 43603 โ†’ 1/3 ๐Ÿ“ zrb project download-dataset โ€ข +๐Ÿค– โ—‹ โ—ท โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: pandas in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (2.1.3) +๐Ÿค– โ—‹ โ—ท โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: numpy<2,>=1.22.4 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (1.26.1) +๐Ÿค– โ—‹ โ—ท โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: python-dateutil>=2.8.2 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2.8.2) +๐Ÿค– โ—‹ โ—ท โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: pytz>=2020.1 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2023.3.post1) +๐Ÿค– โ—‹ โ—ท โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: tzdata>=2022.1 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from pandas) (2023.3) +๐Ÿค– โ—‹ โ—ท โ 43601 โ†’ 1/3 ๐Ÿฎ zrb project install-pandas โ€ข Requirement already satisfied: six>=1.5 in /home/gofrendi/zrb/.venv/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0) Support zrb growth and development! โ˜• Donate at: https://stalchmst.com/donation ๐Ÿ™ Submit issues/PR at: https://github.com/state-alchemists/zrb ๐Ÿค Follow us at: https://twitter.com/zarubastalchmst -๐Ÿค– โ—‹ โ 36795 โ†’ 1/3 ๐Ÿ“ zrb show-stat โ€ข Completed in 2.24128794670105 seconds +๐Ÿค– โ—‹ โ—ท 2023-11-12 09:45:14.366 โ 43598 โ†’ 1/3 ๐ŸŽ zrb project show-stats โ€ข Completed in 2.2365798950195312 seconds sepal_length sepal_width petal_length petal_width count 150.000000 150.000000 150.000000 150.000000 mean 5.843333 3.054000 3.758667 1.198667 @@ -151,9 +134,8 @@ min 4.300000 2.000000 1.000000 0.100000 50% 5.800000 3.000000 4.350000 1.300000 75% 6.400000 3.300000 5.100000 1.800000 max 7.900000 4.400000 6.900000 2.500000 -To run again: zrb show-stat --url "https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv" +To run again: zrb project show-stats --url "https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv" ``` -Now, you can get the statistics properties of any public CSV dataset. > __๐Ÿ“ NOTE:__ When executing a task, you can also provide the parameter directly, for example you want to provide the `url` > diff --git a/docs/faq/does-zrb-has-a-scheduler.md b/docs/faq/does-zrb-has-a-scheduler.md index bc0b86cb..24d37e79 100644 --- a/docs/faq/does-zrb-has-a-scheduler.md +++ b/docs/faq/does-zrb-has-a-scheduler.md @@ -2,9 +2,9 @@ # Do Zrb has a Scheduler? -No. Zrb focus is to help you run complicated tasks in a single run. You will need third party alternatives to make your tasks run by schedule. +No. Zrb focus is to help you run complicated tasks in a single run. You will need third-party alternatives to make your tasks run by schedule. -# Why No Scheduler? +# Why Is No Scheduler? Implementing a Scheduler seems to be easy at the first glance. @@ -15,6 +15,6 @@ However, there are a few reasons why we don't build our own internal scheduler: # What Can I Do to Make a Scheduled Task? -Don't worry, there are some [tricks](../tutorials/run-task-by-schedule.md) you can use. For example you can use infinite loop, Cronjob, or even orchestrator like Airflow. +Don't worry, there are some [tricks](../tutorials/running-task-by-schedule.md) you can use. For example you can use infinite loop, Cronjob, or even orchestrator like Airflow. ๐Ÿ”– [Table of Contents](../README.md) / [FAQ](README.md) diff --git a/docs/getting-started.md b/docs/getting-started.md index abb3554e..db17432c 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -302,19 +302,11 @@ The goal of the tasks is to download any public CSV dataset and provide the stat - Run the Python script to get the statistical properties of the dataset ``` - ๐Ÿผ - โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” - โ”‚ โ”‚ - โ”‚ Install Pandas โ”œโ”€โ” ๐Ÿ“Š - โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” - โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ–บโ”‚ โ”‚ - โ”‚ Show Statistics โ”‚ - โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ–บโ”‚ โ”‚ - โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โ”‚ Download Dataset โ”œโ”€โ”˜ - โ”‚ โ”‚ - โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ - โฌ‡๏ธ + ๐Ÿผ +Install Pandas โ”€โ”€โ”€โ”€โ”€โ” ๐Ÿ“Š + โ”œโ”€โ”€โ–บ Show Statistics +Download Datasets โ”€โ”€โ”˜ + โฌ‡๏ธ ``` ## Scaffolding a Task @@ -385,7 +377,7 @@ from typing import Any from zrb import CmdTask, python_task, StrInput, runner from zrb.builtin.group import project_group -# ๐Ÿผ Define a task to install pandas +# ๐Ÿผ Define a task named `install-pandas` to install pandas install_pandas = CmdTask( name='install-pandas', group=project_group, @@ -395,12 +387,13 @@ install_pandas = CmdTask( # Make install_pandas accessible from the CLI (i.e., zrb project install-pandas) runner.register(install_pandas) -# โฌ‡๏ธ Define a task to download dataset +# โฌ‡๏ธ Define a task named `download-dataset` to download dataset download_dataset = CmdTask( name='download-dataset', group=project_group, inputs=[ - # Allow user to put the CSV dataset URL. + # Define an input named `url` and set it's default value. + # You can access url's input value by using Jinja template: `{{ input.url }}` StrInput( name='url', default='https://raw.githubusercontent.com/state-alchemists/datasets/main/iris.csv' @@ -419,9 +412,9 @@ runner.register(download_dataset) description='show stats', group=project_group, upstreams=[ - # Make sure install_pandas and download_dataset are successfully executed before running show_stats - install_pandas, - download_dataset + # Make sure install_pandas and download_dataset are successfully executed before running show_stats + install_pandas, + download_dataset ], runner=runner # Make show_stats accessible from the CLI (i.e., zrb project show-stats) ) diff --git a/docs/tutorials/README.md b/docs/tutorials/README.md index b5591a4e..1f114b04 100644 --- a/docs/tutorials/README.md +++ b/docs/tutorials/README.md @@ -4,11 +4,12 @@ - [Preparing Your Machine for Development](preparing-your-machine-for-development.md) - [Development to Deployment: Low Code](development-to-deployment-low-code.md) -- [Run Task programmatically](run-task-programmatically.md) -- [Run Task by Schedule](run-task-by-schedule.md) +- [Running Task programmatically](running-task-programmatically.md) +- [Running Task by Schedule](running-task-by-schedule.md) - [Getting Data from Other Tasks](getting-data-from-other-tasks.md) - [Define Task Dynamically](define-task-dynamically.md) - [Copy and Re-use task](copy-and-reuse-task.md) - [Extending CmdTask: Sending Message to Slack](extending-cmd-task.md) +- [Access Task Using Web Interface: Generate PDF Form](accessing-task-using-web-interface.md) ๐Ÿ”– [Table of Contents](../README.md) diff --git a/docs/tutorials/accessing-task-using-web-interface.md b/docs/tutorials/accessing-task-using-web-interface.md new file mode 100644 index 00000000..2ead6454 --- /dev/null +++ b/docs/tutorials/accessing-task-using-web-interface.md @@ -0,0 +1,5 @@ +๐Ÿ”– [Table of Contents](../README.md) / [Tutorials](README.md) + +# Accessing Task Using Web Interface + +๐Ÿ”– [Table of Contents](../README.md) / [Tutorials](README.md) diff --git a/docs/tutorials/run-task-by-schedule.md b/docs/tutorials/running-task-by-schedule.md similarity index 100% rename from docs/tutorials/run-task-by-schedule.md rename to docs/tutorials/running-task-by-schedule.md diff --git a/docs/tutorials/run-task-programmatically.md b/docs/tutorials/running-task-programmatically.md similarity index 100% rename from docs/tutorials/run-task-programmatically.md rename to docs/tutorials/running-task-programmatically.md