Skip to content

Commit

Permalink
template for arlas_cli --help
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvaingaudan committed Nov 15, 2024
1 parent 6a3c21e commit 1fb33b6
Show file tree
Hide file tree
Showing 37 changed files with 1,512 additions and 232 deletions.
43 changes: 34 additions & 9 deletions docs/docs/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ ARLAS collection are built on top on ES index. They describe yhe basic data stru
```shell
> arlas_cli collections --help

Usage: python -m arlas.cli.cli collections [OPTIONS] COMMAND
[ARGS]...
Usage: arlas_cli collections [OPTIONS] COMMAND [ARGS]...

╭─ Options ──────────────────────────────────────────────────────────╮
* --config TEXT Name of the ARLAS configuration to use │
Expand Down Expand Up @@ -49,8 +48,7 @@ The command line options let you specify how the index should be used by the col
```shell
> arlas_cli collections --config local create --help

Usage: python -m arlas.cli.cli collections create [OPTIONS]
COLLECTION
Usage: arlas_cli collections create [OPTIONS] COLLECTION

Create a collection

Expand Down Expand Up @@ -166,17 +164,45 @@ To create the collection, run the following command:
```shell
> arlas_cli collections --config local create --help

Usage: python -m arlas.cli.cli collections create [OPTIONS]
COLLECTION
Usage: arlas_cli collections create [OPTIONS] COLLECTION

Create a collection

╭─ Arguments ────────────────────────────────────────────────────────╮
* collection TEXT Collection's name [default: None] │
│ [required] │
╰────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────╮
│ --model TEXT Name of the model within │
│ your configuration, or URL │
│ or file path │
│ [default: None] │
│ --index TEXT Name of the index │
│ referenced by the │
│ collection │
│ [default: None] │
│ --display-name TEXT Display name of the │
│ collection │
│ [default: None] │
│ --public --no-public Whether the collection is │
│ public or not │
│ [default: no-public] │
│ --owner TEXT Organisation's owner │
│ [default: None] │
│ --orgs TEXT List of organisations │
│ accessing the collection │
│ --id-path TEXT Overide the JSON path to │
│ the id field. │
│ [default: None] │
│ --centroid-path TEXT Overide the JSON path to │
│ the centroid field. │
│ [default: None] │
│ --geometry-path TEXT Overide the JSON path to │
│ the geometry field. │
│ [default: None] │
│ --date-path TEXT Overide the JSON path to │
│ the date field. │
│ [default: None] │
│ --help Show this message and │
│ exit. │
╰────────────────────────────────────────────────────────────────────╯
Expand All @@ -201,8 +227,7 @@ This command line provides a description of the collection structure (fields) an
```shell
> arlas_cli collections --config local describe --help

Usage: python -m arlas.cli.cli collections describe [OPTIONS]
COLLECTION
Usage: arlas_cli collections describe [OPTIONS] COLLECTION

Describe a collection

Expand Down
143 changes: 143 additions & 0 deletions docs/docs/collections.md.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
## ARLAS Collections

ARLAS collection are built on top on ES index. They describe yhe basic data structure for visualization and handle data access policy.

`arlas_cli` provide tools to manage the ARLAS collections with the `collections` command.

**List collections management commands**

<!-- termynal -->
```shell
> !!!execute arlas_cli collections --help
```

## create

The ARLAS Collection is linked to an index or even an index pattern.

The command line options let you specify how the index should be used by the collection.

<!-- termynal -->
```shell
> !!!execute arlas_cli collections --config local create --help
```

!!! note "Collection visibility"

The visibility options (`--public`, `--owner` and `--orgs`) allow you to choose who can access the collection.

!!! warning "--owner"

It is mandatory to associate an organisation to a collection.

Example:

`--owner your.organisation.com`

By default, the organisation referenced in your `config` is used as owner

### Create an ARLAS collection

The collection has to reference an ES index available with the [arlas_cli conf](confs.md#configurations).

The index option set the targeted index:`--index index_name`

!!! tip "Index pattern"

The collection can target an index pattern.
Instead of an index name, the target is an expression using `*` to reference multiple ES indices.

Example:

`--index index_name_prefix*`

All the indices have to share exactly the same data mapping.

The data contained in all referenced indices are then explorable together in arlas.


The collection also describe a basic structure for spatio-temporel datasets:

- **ID path**: A data field containing unique element identifier. `--id-path unique_id_field`
- **Centroid path**: A data field containing a point geometry used for aggregations `--centroid-path point_geom_field`
- **Geometry path**: A data field containing a geometry representing the element `--geometry-path element_geom_field`
- **Date path**: A data field containing the date associated to each element `--date-path date_field`

!!! tip "Pretty name"

A pretty name for the collection can be set at the creation with the `display-name` option

Example:

`--display-name "Pretty Collection Name"`


To create the collection, run the following command:

<!-- termynal -->
```shell
> arlas_cli collections \
--config local \
collection_name \
--index index_name \
--id-path unique_id_field \
--centroid-path point_geom_field \
--geometry-path element_geom_field \
--date-path date_field \
--display-name "Pretty Collection Name"
```

## name

<!-- termynal -->
```shell
> !!!execute arlas_cli collections --config local create --help
```

### Set a pretty name for the collection

## set_alias

### Set a pretty name for a data field

## list

### List available collections

## describe

This command line provides a description of the collection structure (fields) and of its metadata.

<!-- termynal -->
```shell
> !!!execute arlas_cli collections --config local describe --help
```
### Describe a collection

## count

### Count the number of element within a collection

## sample

### Display a sample of the collection data

## private

### Set the collection as private

## public

### Set the collection as public

### Define visibility policy for collections

## share

## unshare

### Share collections between organisations

## delete

### Delete an organisation
4 changes: 0 additions & 4 deletions docs/docs/collections_1.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/docs/collections_2.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/docs/collections_3.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/docs/collections_4.md

This file was deleted.

Loading

0 comments on commit 1fb33b6

Please sign in to comment.