Skip to content

Commit ff02f4a

Browse files
committed
Improved documentation
Added UML diagrams
1 parent 911394d commit ff02f4a

File tree

5 files changed

+99
-17
lines changed

5 files changed

+99
-17
lines changed

README.md

+27-17
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22

33
CLI tool for easy usage of the Superset API.
44

5-
[![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)
6-
7-
* [Installation](#installation)
8-
* [Overview](#overview)
9-
* [Usage](#usage)
10-
* [Commands](#commands)
11-
* [Examples](#examples)
12-
* [Used Libraries](#used-libraries)
13-
* [Issues, Ideas And Bugs](#issues-ideas-and-bugs)
14-
* [License](#license)
15-
* [Contribution](#contribution)
5+
[![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)
6+
7+
## Overview
8+
9+
![overview](https://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/NewTec-GmbH/pyJiraCli/main/doc/uml/context.puml)
10+
11+
More information on the deployment and architecture can be found in the [doc](./doc/README.md) folder.
1612

1713
## Installation
1814

@@ -22,21 +18,35 @@ cd pySupersetCli
2218
pip install .
2319
```
2420

25-
## Overview
26-
27-
WIP
28-
2921
## Usage
3022

3123
Show help information:
3224

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

29+
### Flags
30+
31+
| Flag | Description |
32+
| :-----------: | ----------------------------------------------------------------------------------------------- |
33+
| --verbose , -v | Print full command details before executing the command. Enables logs of type INFO and WARNING. |
34+
| --version | Import a ticket from a JSON file. |
35+
| --help , -h | Show the help message and exit. |
36+
| --no_ssl | Disables SSL certificate verification. |
37+
| --basic_auth | Use basic authentication instead of LDAP. |
38+
39+
### Login options
40+
41+
To connect to the Superset server, provide all credentials via Command Line arguments:
42+
- `--server <server URL>` is required.
43+
- ID using `--user <user>` and `--password <password>`
44+
3745
## Commands
3846

39-
WIP
47+
| Command | Description |
48+
| :-----------------------------------------: | --------------------------------------------------- |
49+
|[upload](./doc/commands/upload.md) | Upload a JSON file to a Superset instance. |
4050

4151
## Examples
4252

design/README.md doc/README.md

File renamed without changes.

doc/commands/upload.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Upload
2+
3+
Upload a JSON file to a Superset instance.
4+
5+
The user mus supply the following parameters:
6+
7+
- database: DB to upload the data to.
8+
- table: Existing table in the database to save the data to.
9+
- file: JSON-formatted file containing the data.
10+
11+
```cmd
12+
pySupersetCli -u <user> -p <password> -s <server_url> --basic_auth --no_ssl upload --database "TEST" --table "dummy" --file "input.json"
13+
```
14+
15+
## JSON File format
16+
17+
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.
18+
19+
If the table already exists, it is not possible to change the column names/order (no changes in the schema allowed).

doc/uml/architecture.puml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@startuml ArchitectureDiagram
2+
3+
package "pySupersetCli" as pySupersetCli {
4+
component "Main Entry Point" as main
5+
component "superset"as server
6+
component "Commands" <<command>> as cmd
7+
}
8+
9+
package "Python" as python {
10+
component "Argparse" as argparse
11+
component "Requests" as requests
12+
}
13+
14+
main *--> server : <<uses>>
15+
main o--> cmd : 0..*
16+
main *--> argparse : <<uses>>
17+
18+
server *--> requests : <<uses>>
19+
20+
@enduml

doc/uml/deployment.puml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@startuml DeploymentDiagram
2+
3+
node "Apache Superset"<<virtual-machine>> as superset
4+
5+
database "DB Server" {
6+
component "Database" as supersetDb
7+
8+
note bottom of supersetDb
9+
The database is project specific, means
10+
one database per project.
11+
end note
12+
}
13+
14+
interface "REST API" as supersetRestApi
15+
16+
superset --- supersetRestApi
17+
superset -- supersetDb
18+
19+
node "Continuous Integration Server"<<virtual-machine>> {
20+
21+
package "scripts" {
22+
component "pySupersetCli" as pySupersetCli
23+
}
24+
}
25+
26+
supersetRestApi )-- pySupersetCli: <<writes>>
27+
28+
note top of superset
29+
Report frontend for project metrics.
30+
end note
31+
32+
33+
@enduml

0 commit comments

Comments
 (0)