Skip to content

Commit 3f43401

Browse files
committed
deleted compy of help docu and provided short instructions
1 parent d6d5dd5 commit 3f43401

File tree

1 file changed

+4
-149
lines changed

1 file changed

+4
-149
lines changed

docs/source/cli.md

Lines changed: 4 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Command Line Interface
22

3-
THIS DOCUMENT IS OUTDATED: Please use the `--help` flag of the CLI.
3+
The Mapswipe Backend provides a Command Line Interface(CLI) with which the users can interact with the program.
4+
They can be used for example to create projects, which were uploaded to the [manager-dashboard](for_mapswipe_managers.html),
5+
or to export statistics on the finished projects. To get a comprehensible lists of the available commands use the ```--help``` flag.
46

5-
---
6-
7-
This document describes how to use the command line interface of MapSwipe Worker.
7+
```mapswipe_workers --help``` would get you all possible commands, while e.g. ```mapswipe_workers archive --help``` would get you additional information on how to use that command.
88

99
In our current deployment setup the commands of the MapSwipe Workers CLI are hard-coded in the Docker-Compose File.
1010

@@ -13,148 +13,3 @@ You can run these commands also using docker-compose:
1313
```
1414
docker-compose run mapswipe_workers mapswipe_workers --help
1515
```
16-
17-
18-
```
19-
Usage: mapswipe_workers [OPTIONS] COMMAND [ARGS]...
20-
21-
Options:
22-
-v, --verbose
23-
--version Show the version and exit.
24-
--help Show this message and exit.
25-
26-
Commands:
27-
create-projects
28-
create-tutorial
29-
firebase-to-postgres
30-
generate-stats
31-
run
32-
user-management
33-
```
34-
35-
36-
## Create projects from submitted project drafts
37-
38-
```
39-
Usage: mapswipe_workers create-projects [OPTIONS]
40-
41-
Options:
42-
-s, --schedule [m|h|d] Will create projects every 10 minutes (m), every
43-
hour (h) or every day (d).
44-
--help Show this message and exit.
45-
```
46-
47-
48-
## Transfer data from Firebase to Postgres
49-
50-
```
51-
Usage: mapswipe_workers firebase-to-postgres [OPTIONS]
52-
53-
Options:
54-
-s, --schedule [m|h|d] Will update and transfer relevant data (i.a. users
55-
and results) from Firebase into Postgres every 10
56-
minutes (m), every hour (h) or every day (d).
57-
--help Show this message and exit.
58-
```
59-
60-
61-
## Generate Statistics
62-
63-
```
64-
Usage: mapswipe_workers generate-stats [OPTIONS]
65-
66-
Options:
67-
-s, --schedule [m|h|d] Generate stats every 10 minutes (m), every hour (h)
68-
or every day (d).
69-
--project_id_list TEXT provide project id strings as a list stats will be
70-
generated only for these projects.
71-
Use it like '["project_a", "project_b"]'
72-
--help Show this message and exit.
73-
```
74-
75-
## Generate Statistics for all projects
76-
77-
Ideally you run this using a separate docker container. e.g. like this:
78-
79-
```
80-
docker-compose run mapswipe_workers mapswipe_workers generate-stats-all-projects
81-
```
82-
83-
```
84-
Usage: mapswipe_workers generate-stats-all-projects [OPTIONS]
85-
86-
Options:
87-
-s, --schedule [m|h|d] Generate stats every 10 minutes (m), every hour (h)
88-
or every day (d).
89-
--help Show this message and exit.
90-
```
91-
92-
## User Management
93-
94-
```
95-
Usage: mapswipe_workers user-management [OPTIONS]
96-
97-
Options:
98-
--email TEXT The email of the MapSwipe user. [required]
99-
--manager BOOLEAN Set option to grant or remove project manager
100-
credentials. Use true to grant credentials. Use false to
101-
remove credentials.
102-
--help Show this message and exit.
103-
```
104-
105-
## Archive Projects
106-
107-
```
108-
Usage: mapswipe_workers archive [OPTIONS]
109-
110-
Archive projects in Postgres. Delete groups, tasks and results from
111-
Firebase.
112-
113-
Options:
114-
-i, --project-id TEXT Archive project with giving project id
115-
--project-ids TEXT Archive multiple projects. Provide project id strings
116-
as a list: '["project_a", "project_b"]'
117-
118-
--help Show this message and exit.
119-
120-
```
121-
122-
You can get the project ids for the projects to be archive either from the manager dashboard or query directly in postgres. For example:
123-
124-
```
125-
SELECT project_id
126-
FROM projects
127-
WHERE status = 'finished' AND created < '2020-09-01'
128-
```
129-
130-
## Delete Projects
131-
132-
```
133-
Usage: mapswipe_workers delete [OPTIONS]
134-
135-
Delete tasks, groups, project and results.
136-
137-
Options:
138-
-i, --project-id TEXT Delete project with giving project id
139-
--project-ids TEXT Delete multiple projects. Provide project id strings
140-
as a list: '["project_a", "project_b"]'
141-
142-
--help Show this message and exit.
143-
```
144-
145-
146-
## Create Tutorial from json file (e.g. provided in sample data)
147-
148-
```
149-
Usage: mapswipe_workers create-tutorial [OPTIONS]
150-
151-
Options:
152-
--input_file TEXT The json file with your tutorial information. [required]
153-
--help Show this message and exit.
154-
155-
```
156-
157-
## Run a script which requires mapswipe_workers library
158-
```
159-
docker-compose run mapswipe_workers python3 python_scripts/add_project_geometries_to_api.py
160-
```

0 commit comments

Comments
 (0)