a commandline interface tool for Geonode Rest API v2
Project description
geonodectl Documentation
Overview
geonodectl is a command-line interface (CLI) tool for interacting with the GeoNode REST API v2. It allows users to manage datasets, resources, documents, maps, users, and more from the command line, making it ideal for automation, scripting, and power users.
- Project Repository: https://github.com/GeoNodeUserGroup-DE/geonodectl
- License: MIT
Features
- List, describe, upload, patch, and delete datasets
- Manage resources, documents, maps, geoapps, users, uploads, execution requests, and keywords
- Download metadata and manage linked resources
- Supports authentication and secure API access
- Supports pagination, filtering, and ordering
- Pre-commit hooks and CI for code quality (black, mypy, flake8)
Installation
From PyPI (recommended)
pip install geonodectl
From Source (latest development version)
pip install -e 'git+https://github.com/GeoNodeUserGroup-DE/geonodectl.git@main#egg=geonodectl'
Development Setup
pip install .[test]
pre-commit install
Configuration
Set the following environment variables to connect to your GeoNode instance:
GEONODE_API_URL=https://your-geonode-instance/api/v2/
GEONODE_API_BASIC_AUTH=<base64-user:password>
You can generate the basic auth string with:
echo -n user:password | base64
Usage
- exmaple docs example to upload and edit a dataset with geonodectl
Get help and see available commands:
geonodectl --help
Example: List all datasets
geonodectl dataset list
Example: Upload a shapefile
geonodectl dataset upload -f /path/to/file.shp --title "My Dataset"
Example: Patch a dataset
geonodectl dataset patch 36 --set '{"category":{"identifier":"biota"}}'
Command Reference
resources/resource: List, delete, download metadatadataset/ds: List, delete, patch, describe, uploaddocuments/doc/document: List, delete, patch, describe, uploadmaps: List, delete, patch, describe, creategeoapps/apps: List, delete, patch, describeusers/user: List, delete, patch, describe, createuploads: List, describeexecutionrequest: List, describekeywords: List, describetkeywords: List, describetkeywordlabels: List, describe
Development
Code Quality
This project uses pre-commit hooks and GitHub Actions for:
- Black (code formatting)
- mypy (type checking)
- flake8 (linting)
To run checks locally:
pre-commit run --all-files
Testing
Tests are located in src/geonoderest/tests/.
Run tests with:
pytest
Contribution Guide
- Fork the repository and create a feature branch.
- Install development dependencies:
pip install .[test] - Install pre-commit hooks:
pre-commit install - Make your changes and ensure all checks pass.
- Submit a pull request.
License
This project is licensed under the MIT License.
Further Reading
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geonodectl-0.3.1.tar.gz.
File metadata
- Download URL: geonodectl-0.3.1.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e391629d5f09f606e74d4041305ad90334c600a493bce41d559fbcd40256eeab
|
|
| MD5 |
d6b8e990569d9c3403ea574a74354389
|
|
| BLAKE2b-256 |
3e9dfa48e7850ff623e9c32b7013ded5fe189fb6140cdeb6527c5fc712608686
|
File details
Details for the file geonodectl-0.3.1-py3-none-any.whl.
File metadata
- Download URL: geonodectl-0.3.1-py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65664e7add245e59a9debf98cb34440eded6e85716913e049c564b5555a937b8
|
|
| MD5 |
b9ed9001733634469c1f3d3f305bd29b
|
|
| BLAKE2b-256 |
9eb467e1e9633f0edfe6213953382a6fac6f77a726c3bc106065217f1c462736
|