Skip to content

Commit 69de995

Browse files
Merge pull request #2 from GeoNodeUserGroup-DE/feature_patch-objects
refectoring, adding functions
2 parents da77b6c + 3cd1b32 commit 69de995

File tree

15 files changed

+1067
-602
lines changed

15 files changed

+1067
-602
lines changed

.github/workflows/python-check.yaml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,24 @@ jobs:
2323
build:
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v3
27-
- name: Set up Python 3.11
28-
uses: actions/setup-python@v3
29-
with:
30-
python-version: "3.11"
31-
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install flake8 mypy
35-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
36-
- name: Lint with flake8
37-
run: |
38-
# stop the build if there are Python syntax errors or undefined names
39-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42-
- name: Test with mypy
43-
run: |
44-
mypy geonodectl --check-untyped-defs
26+
- uses: actions/checkout@v3
27+
- name: Set up Python 3.11
28+
uses: actions/setup-python@v3
29+
with:
30+
python-version: "3.11"
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install flake8 mypy black
35+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
36+
- name: run black check
37+
run: |
38+
black --check .
39+
- name: Lint with flake8
40+
run: |
41+
# stop the build if there are Python syntax errors or undefined names
42+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
43+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
44+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
45+
- name: Test with mypy
46+
run: "mypy geonodectl --check-untyped-defs"

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
**geonodectl** is a commandline interface tool for [geonode](https://github.com/GeoNode/geonode). It uses the [geonode apiv2](https://docs.geonode.org/en/master/devel/api/V2/index.html) to interact with a geonode installation.
44

5+
## How to use
6+
57
geonodectl has currently the following capabilities:
68
```
79
❯ ./geonodectl --help
@@ -38,26 +40,27 @@ options:
3840
```
3941

4042
Currently not all features of the API are implemented. Here is a list of what you can do with geonodectl:
41-
| geonode resource | capabilities | description |
42-
|------------------|--------------|--------------|
43-
| resource | list, delete, download metadata | resource can handle all kinds of geonode-resources except people |
44-
| dataset | list, delete, upload | |
45-
| documents | list, delete, upload | |
46-
| maps | list, delete | |
47-
| geoapps | list, delete | |
48-
| people | list | |
49-
| uploads | list | |
43+
| geonode resource | capabilities |
44+
|------------------|--------------|
45+
| resource | list, delete, download metadata |
46+
| dataset | list, delete, patch, describe, upload |
47+
| documents | list, delete, patch, describe, upload |
48+
| maps | list, delete, patch, describe |
49+
| geoapps | list, delete, patch, describe |
50+
| people | list, delete, patch, describe |
51+
| uploads | list |
5052

5153
This project is WIP, so feel free to add more functions to this project.
5254

5355
## Usage
5456

55-
first of all install the requirements for this project with:
57+
first install the project with:
58+
5659
```
57-
pip install -r requirements.txt
60+
pip install https://github.com/GeoNodeUserGroup-DE/geonodectl.git
5861
```
5962

60-
Further **geonodectl** requires to set two environment variables like:
63+
Additionally to package install, **geonodectl** requires to set two environment variables to connect to a geonode instance like:
6164
```
6265
GEONODECTL_URL: https://master.demo.geonode.org/api/v2/ # make sure to supply full api url
6366
GEONODECTL_BASIC: dXNlcjpwYXNzd29yZA== # you can generate this string like: echo -n user:password | base64
@@ -96,7 +99,7 @@ Now you are ready to go:
9699
| 1 | wheaterdata 2004 | admin | 2023-01-23T10:19:00Z | True | True | PROCESSED | https://geonode.corki.bonares.de/catalogue/#/dataset/1 |
97100
98101
# delete dataset
99-
❯ ./geonodectl ds delete -pk 36
102+
❯ ./geonodectl ds delete 36
100103
deleted ...
101104
102105
# check if deleted:

0 commit comments

Comments
 (0)