From 8b35c48b1b842ead68f44896d7032cebbdf707f9 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Wed, 13 Dec 2023 12:25:22 +0200 Subject: [PATCH] Update the README to add detailed information about the project. --- README.md | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/README.md b/README.md index 791422f..31e6ab8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,92 @@ It creates and sends a notification to the server. +# Ecosystem +- [notification-server](https://gitlab.com/KKlochko/notification-server) +- [notification-producer](https://gitlab.com/KKlochko/notification-producer) (current) +- [notification-client](https://gitlab.com/KKlochko/notification-client) + +# Setup + +- Setup [notification-server](https://gitlab.com/KKlochko/notification-server), before continue. +- Clone this repository. +- Ensure that python and pip are installed: + ``` + python --version + python -m pip -V + # or + python3 --version + python3 -m pip -V + ``` + +- Create a virtual environment if needed: + Using `virtualenv`: + ``` + virtualenv .venv + . .venv/bin/activate + # or + virtualenv3 .venv + . .venv/bin/activate + ``` + + Using `poetry`: + ``` + poetry shell + ``` + +- Install the dependencies: + Using `pip`: + ``` + pip install -r requirements.txt + # or + pip3 install -r requirements.txt + ``` + + Using `poetry`: + ``` + poetry install + ``` + +- Run the main file: + Use options ip and port to change the server address. 127.0.0.1:5554 is the default address. + ``` + python -m notification_producer.main --help + # or + python3 -m notification_producer.main --help + + ``` + +# Commands + +- Notify in the interactive mode: + ``` + python -m notification_producer.main up + # or + python3 -m notification_producer.main up + ``` + + - Exit: + - Enter the empty `title` and the empty`message`. + - `Ctlr + C` (`C-c`). + +- Notify once using text: + ``` + python -m notification_producer.main notify message --message hello + python -m notification_producer.main notify message --title greeting --message hello + # or + python3 -m notification_producer.main notify message --message hello + python3 -m notification_producer.main notify message --title greeting --message hello + ``` + +- Notify once using a file content: + ``` + python -m notification_producer.main notify file --file README.md + python -m notification_producer.main notify file --title file_greeting --file README.md + # or + python3 -m notification_producer.main notify file --file README.md + python3 -m notification_producer.main notify file --title file_greeting --file README.md + ``` + # Author Kostiantyn Klochko (c) 2023