Skip to main content

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.

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 metadata
  • dataset / ds: List, delete, patch, describe, upload
  • documents / doc / document: List, delete, patch, describe, upload
  • maps: List, delete, patch, describe, create
  • geoapps / apps: List, delete, patch, describe
  • users / user: List, delete, patch, describe, create
  • uploads: List, describe
  • executionrequest: List, describe
  • keywords: List, describe
  • tkeywords: List, describe
  • tkeywordlabels: 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

  1. Fork the repository and create a feature branch.
  2. Install development dependencies: pip install .[test]
  3. Install pre-commit hooks: pre-commit install
  4. Make your changes and ensure all checks pass.
  5. 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

geonodectl-0.3.0.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geonodectl-0.3.0-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file geonodectl-0.3.0.tar.gz.

File metadata

  • Download URL: geonodectl-0.3.0.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for geonodectl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2fcc57cd76031b40cdc37c360e60c64dcd671b4424e217208508c8455d022193
MD5 4f872b2994c2a701021975e1c35d305d
BLAKE2b-256 3eae60eec947f007dd8a6cf7b7264e083809b84e2a3c7e421586459274160019

See more details on using hashes here.

File details

Details for the file geonodectl-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: geonodectl-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 42.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for geonodectl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b595f7f8673ea63f03d9203159282805d82ff59576862eadaf1cd54e0f377f70
MD5 e136074dc0acc76e06e9183b59954f5c
BLAKE2b-256 4d6dcde7142ae3ac4f4de3dcb32a3b2388eac43dc59fae036b71d368d1c15063

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page