Skip to content

Commit

Permalink
Improved documentation
Browse files Browse the repository at this point in the history
Added UML diagrams
  • Loading branch information
gabryelreyes committed Jul 16, 2024
1 parent 911394d commit ff02f4a
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 17 deletions.
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

CLI tool for easy usage of the Superset API.

[![License](https://img.shields.io/badge/license-bsd-3.svg)](https://choosealicense.com/licenses/bsd-3-clause/) [![Repo Status](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) [![CI](https://github.com/NewTec-GmbH/pySupersetCli/actions/workflows/ci.yml/badge.svg)](https://github.com/NewTec-GmbH/pySupersetCli/actions/workflows/ci.yml)

* [Installation](#installation)
* [Overview](#overview)
* [Usage](#usage)
* [Commands](#commands)
* [Examples](#examples)
* [Used Libraries](#used-libraries)
* [Issues, Ideas And Bugs](#issues-ideas-and-bugs)
* [License](#license)
* [Contribution](#contribution)
[![License](https://img.shields.io/badge/license-bsd-3.svg)](https://choosealicense.com/licenses/bsd-3-clause/) [![Repo Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![CI](https://github.com/NewTec-GmbH/pySupersetCli/actions/workflows/ci.yml/badge.svg)](https://github.com/NewTec-GmbH/pySupersetCli/actions/workflows/ci.yml)

## Overview

![overview](https://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/NewTec-GmbH/pyJiraCli/main/doc/uml/context.puml)

More information on the deployment and architecture can be found in the [doc](./doc/README.md) folder.

## Installation

Expand All @@ -22,21 +18,35 @@ cd pySupersetCli
pip install .
```

## Overview

WIP

## Usage

Show help information:

```cmd
pySupersetCli --help
pySupersetCli [-h] -u <user> -p <password> -s <server_url> [--version] [-v] [--no_ssl] [--basic_auth] {command} {command_options}
```

### Flags

| Flag | Description |
| :-----------: | ----------------------------------------------------------------------------------------------- |
| --verbose , -v | Print full command details before executing the command. Enables logs of type INFO and WARNING. |
| --version | Import a ticket from a JSON file. |
| --help , -h | Show the help message and exit. |
| --no_ssl | Disables SSL certificate verification. |
| --basic_auth | Use basic authentication instead of LDAP. |

### Login options

To connect to the Superset server, provide all credentials via Command Line arguments:
- `--server <server URL>` is required.
- ID using `--user <user>` and `--password <password>`

## Commands

WIP
| Command | Description |
| :-----------------------------------------: | --------------------------------------------------- |
|[upload](./doc/commands/upload.md) | Upload a JSON file to a Superset instance. |

## Examples

Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions doc/commands/upload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Upload

Upload a JSON file to a Superset instance.

The user mus supply the following parameters:

- database: DB to upload the data to.
- table: Existing table in the database to save the data to.
- file: JSON-formatted file containing the data.

```cmd
pySupersetCli -u <user> -p <password> -s <server_url> --basic_auth --no_ssl upload --database "TEST" --table "dummy" --file "input.json"
```

## JSON File format

The JSON file must contain a JSON Object, in which the keys are interpreted as the columns of the table. Nested objects are not accepted and the command will fail in case a nested object is supplied. Each time the command is called, a new row will be appended to the database/table specified.

If the table already exists, it is not possible to change the column names/order (no changes in the schema allowed).
20 changes: 20 additions & 0 deletions doc/uml/architecture.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@startuml ArchitectureDiagram

package "pySupersetCli" as pySupersetCli {
component "Main Entry Point" as main
component "superset"as server
component "Commands" <<command>> as cmd
}

package "Python" as python {
component "Argparse" as argparse
component "Requests" as requests
}

main *--> server : <<uses>>
main o--> cmd : 0..*
main *--> argparse : <<uses>>

server *--> requests : <<uses>>

@enduml
33 changes: 33 additions & 0 deletions doc/uml/deployment.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@startuml DeploymentDiagram

node "Apache Superset"<<virtual-machine>> as superset

database "DB Server" {
component "Database" as supersetDb

note bottom of supersetDb
The database is project specific, means
one database per project.
end note
}

interface "REST API" as supersetRestApi

superset --- supersetRestApi
superset -- supersetDb

node "Continuous Integration Server"<<virtual-machine>> {

package "scripts" {
component "pySupersetCli" as pySupersetCli
}
}

supersetRestApi )-- pySupersetCli: <<writes>>

note top of superset
Report frontend for project metrics.
end note


@enduml

0 comments on commit ff02f4a

Please sign in to comment.