diff --git a/README.md b/README.md index 15c2b5e..8029457 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ pyMetricCli is a collection of scripts and API implementations for generating an - [Installation](#installation) - [Overview](#overview) - [Usage](#usage) -- [Commands](#commands) - [Examples](#examples) - [Used Libraries](#used-libraries) - [Issues, Ideas And Bugs](#issues-ideas-and-bugs) @@ -16,29 +15,69 @@ pyMetricCli is a collection of scripts and API implementations for generating an ## Installation -WIP +```cmd +git clone https://github.com/NewTec-GmbH/pyMetricCli.git +cd pyMetricCli +pip install . +``` + +This will also install the latest version of [pyJiraCli](https://github.com/NewTec-GmbH/pyJiraCli), [pyPolarionCli](https://github.com/NewTec-GmbH/pyPolarionCli), and [pySupersetCli](https://github.com/NewTec-GmbH/pySupersetCli) in your Python environment. ## Overview -WIP +pyMetricCli requires an adapter file to be supplied by the user. This shall contain the credentials and result-handling logic for the seach results. Please **DO NOT** commit this file into any public repository as your credentials might be exposed. + +An example adapter can be found [here](examples/adapter/adapter.py). ## Usage -WIP +Show help information: + +```cmd +pyJiraCli --help +``` + +Usage: + +```cmd +usage: pyMetricCli [-h] -a [--version] [-v] + +Collection of scripts and API implementations for generating and playing with metrics. + +options: + -h, --help show this help message and exit + --version show program's version number and exit + -v, --verbose Print full command details before executing the command. Enables logs of type INFO and WARNING. + +required arguments: + -a , --adapter_file + Adapter file to be used. +``` + +Example: + +```cmd +pyJiraCli --verbose --adapter_file "examples\adapter\adapter.py" +``` + +### Adapter -## Commands +The adapter file must contain the `Adapter` Class derived from the `AdapterInterface`, including all the methods and members defined in the interface. -WIP +The `***_config` dictionaries must be filled with the user credentials for each service. The `output` dictionary defines the columns of the table that will be sent to Superset, and this cannot be changed after the first time the script is ran. If you are receiving an Error 422 from Superset, a change in this dictionary may be the reason and you should contact your administrator so resolve the issue. ## Examples -Check out the all the [Examples](./examples). +Check out the [Examples](./examples) in the corresponding folder. ## Used Libraries Used 3rd party libraries which are not part of the standard Python package: - [toml](https://github.com/uiri/toml) - Parsing [TOML](https://en.wikipedia.org/wiki/TOML) - MIT License +- [pyJiraCli](https://github.com/NewTec-GmbH/pyJiraCli) - Interfacing with Jira - BSD-3 License +- [pyPolarionCli](https://github.com/NewTec-GmbH/pyPolarionCli) - Interfacing with Polarion - BSD-3 License +- [pySupersetCli](https://github.com/NewTec-GmbH/pySupersetCli) - Interfacing with Superset - BSD-3 License ## Issues, Ideas And Bugs diff --git a/examples/README.md b/examples/README.md index cc94062..7e783ab 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,10 +1,7 @@ # Examples -## Configuration File - -The configuration file must have the same structure as `examples\config.json`. - ## Adapter Each project must provide an `Adapter` class with the methods `handle_jira` and `handle_polarion` to pack the data from the search results into the output dictionary. -The declaration, arguments and name of the methods must remain the same as in `examples\adapter\adapter.py`, otherwise the program will not work correctly. \ No newline at end of file +Additionally, the dictionaries `output`, `jira_config`, `polarion_config` and `superset_config` must also be supplied. +The declaration, arguments and name of the methods must remain the same as in `examples\adapter\adapter.py`, otherwise the program will not work correctly. diff --git a/examples/config.json b/examples/config.json deleted file mode 100644 index c8febc7..0000000 --- a/examples/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "adapter_path": "examples/adapter/adapter.py", - "jira":{}, - "polarion":{}, - "superset":{} -} \ No newline at end of file