Browse Source

Documentation update

Nikola Kotur 3 years ago
parent
commit
d56d950d38
2 changed files with 32 additions and 3 deletions
  1. 31 2
      README.md
  2. 1 1
      src/ynrc/main.py

+ 31 - 2
README.md

@@ -2,8 +2,6 @@
 
 Weekly spending reports from YNAB to Rocket.chat.
 
-## Preparation
-
 ## Installation
 
 YNRC is simple and complete Python package, so if you know how to handle Python packages you can use it right away. For example, to install it in your virutal environment you would:
@@ -26,6 +24,37 @@ Afterwards you can run YNRC (or add it to your crontab) as simple as:
 docker run -it --rm ynrc weekly_report --ynab-api-key <add the rest of command line options, see --help>
 ```
 
+## Preparation
+
+First you will need YNAB Personal Access Token. To create a new one follow this path in YNAB Web application: Account Settings -> Developer Settings -> New Personal Access Token. Visit [official documentation](https://api.youneedabudget.com/#quick-start) for more information.
+
+Then, create new incoming integration in Rocket.Chat by visiting Administration -> Integrations -> New -> Incoming page. Once you have all the tokens ready, you can run YNRC!
+
+## Usage
+
+Help page explains it all:
+
+```
+usage: weekly_report [-h] [--version] --ynab-api-key YNAB_API_KEY --ynab-budget-name YNAB_BUDGET_NAME --rocketchat-webhook ROCKETCHAT_WEBHOOK
+                     [--rocketchat-avatar-url ROCKETCHAT_AVATAR_URL] [-v] [-vv]
+
+You Need Rocket.Chat: send weekly YNAB reports to your Rocket.Chat instance
+
+optional arguments:
+  -h, --help            show this help message and exit
+  --version             show program's version number and exit
+  --ynab-api-key YNAB_API_KEY
+                        YNAB API key
+  --ynab-budget-name YNAB_BUDGET_NAME
+                        YNAB budget name
+  --rocketchat-webhook ROCKETCHAT_WEBHOOK
+                        Rocket.Chat webhook URL
+  --rocketchat-avatar-url ROCKETCHAT_AVATAR_URL
+                        Rocket.Chat user avatar URL
+  -v, --verbose         set loglevel to INFO
+  -vv, --very-verbose   set loglevel to DEBUG
+```
+
 ## License
 
 Distributed under the MIT License. See `LICENSE.txt` for more information.

+ 1 - 1
src/ynrc/main.py

@@ -18,7 +18,7 @@ _logger = logging.getLogger(__name__)
 
 
 def parse_args(args):
-    parser = argparse.ArgumentParser(description="Just a Fibonacci demonstration")
+    parser = argparse.ArgumentParser(description="You Need Rocket.Chat: send weekly YNAB reports to your Rocket.Chat instance")
     parser.add_argument(
         "--version",
         action="version",