Skip to main content

PyGeoWeaver

Latest Release Static Badge PyPI
Getting Help Documentation Status
Activity PyPI - Downloads GitHub commit activity (branch)
Community Static Badge
License GitHub

PyGeoWeaver is a Python package that provides a convenient and user-friendly interface to interact with GeoWeaver, a powerful geospatial data processing application written in Java. With PyGeoWeaver, Jupyter notebook and JupyterLab users can seamlessly integrate and utilize the capabilities of GeoWeaver within their Python workflows.

Installation

To install PyGeoWeaver, ensure you have Python 3.7+.

Java / Geoweaver selection (automatic):

  • Java 17+ → downloads and runs latest Geoweaver (2.2+ / Spring Boot 3) from the latest release asset.
  • No Java → PyGeoWeaver installs Temurin 17 under ~/jdk, then uses latest Geoweaver.
  • PyGeoWeaver-managed JDK (~/jdk/...) older than 17 → bumps that JDK to 17 before start, then uses latest Geoweaver.
  • System JDK older than 17 (not under ~/jdk) → keeps your JDK and automatically uses Geoweaver 2.1.x (legacy jar), with a clear warning.

You can also install a managed JDK yourself:

gw installjdk

Cluster / no-sudo note (fixed in 1.4.1): an old ~/jdk.tar.gz from Java 11 must not be reused when installing Temurin 17. PyGeoWeaver now detects a mismatched archive, downloads a fresh copy, and moves aside other ~/jdk/jdk-* folders before extract so Permission denied on locked jdk-11* files is avoided.

Manual legacy jar (optional): v2.1.7 jar.

You can then install PyGeoWeaver using pip:

pip install pygeoweaver

AI agents (fast, over SSH)

gw agent … drives a running Geoweaver through its Agent API: JSON output, ~0.2 s per call instead of booting a JVM, and every change shows up live in the Geoweaver GUI. Built for AI agents that reach Geoweaver over SSH (firewall, VPN, Open OnDemand).

gw agent ensure                       # make sure Geoweaver is up (never restarts it)
gw agent login                        # once: GUI password -> stored token (0600)
gw agent process create --name hello --lang python --code 'print(42)'
gw agent process run <id> --wait
gw agent guide                        # playbook for the AI

See docs/agent-ssh.md.

Startup

To start using PyGeoWeaver, you can launch the GeoWeaver graphical user interface by executing the following command in a Jupyter notebook cell:

import geoweaver
geoweaver.start()

Alternatively, you can start GeoWeaver directly from the terminal:

gw start

Options and Help Text

PyGeoWeaver provides several commands to interact with GeoWeaver. Below is a list of available options and their descriptions:

  • Launching GeoWeaver GUI: Opens the GeoWeaver interface.
    geoweaver.start()
    
    or
    </code></pre>
    </li>
    </ul>
    <p>gw start</p>
    <pre><code>
    - **Stopping GeoWeaver**: Stops the GeoWeaver interface. By default this only
    stops the JVM (and prints a hint if the H2 database is oversized). Full H2
    rebuild remains `gw cleanh2db`; optional short compact: `gw stop --maintain-h2`.
    ```python
    geoweaver.stop()
    

    or

    gw stop
    
    • Status / health check: Show runtime, HTTP, Java, config, and H2 database status. Passwords and JDBC credentials are never printed.
      </code></pre>
      </li>
      </ul>
      <p>gw status
      gw status --json</p>
      <pre><code>
      - **Listing Existing Objects**: Lists hosts, processes, and workflows.
      ```python
      geoweaver.list_hosts()
      geoweaver.list_processes()
      geoweaver.list_workflows()
      
      • Running a Workflow: Executes a specified workflow.

        geoweaver.run_workflow("workflow_id", "host_id_list", "password_list", "environment_list")
        
      • Exporting a Workflow: Exports a workflow to a ZIP file.

        geoweaver.export_workflow("workflow_id", "workflow_zip_save_path")
        
      • Importing a Workflow: Imports a workflow from a ZIP file.

        geoweaver.import_workflow("<workflow_zip_file_path>")
        
      • Viewing Workflow and Process History: Retrieves the history of a workflow or process run.

        geoweaver.get_workflow_history("<workflow_history_id>")
        geoweaver.get_process_history("<process_history_id>")
        
      • Inspecting Process Source Code: Views the source code of a process.

        geoweaver.detail_process("<process_id>")
        
      • Inspecting Workflow Configuration: Checks the configuration details of a workflow.

        geoweaver.detail_workflow("<workflow_id>")
        
      • Inspecting Host Details: Retrieves the details of a host.

        geoweaver.detail_host("<host_id>")
        

      Documentation

      For detailed documentation and examples, please visit the PyGeoWeaver Documentation.

      Contributing

      Contributions to PyGeoWeaver are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository.

      Releasing

      Maintainers can publish a new version to GitHub Releases + PyPI with:

      # After merging the release branch to main:
      ./scripts/publish-release.sh 1.4.0 --bump
      # Or auto-increment patch from pyproject.toml:
      ./scripts/publish-release.sh --bump-patch
      # Preview only:
      ./scripts/publish-release.sh 1.4.1 --bump --dry-run
      

      This bumps pyproject.toml (optional), pushes to main, creates tag vX.Y.Z, waits for .github/workflows/publish-to-pypi.yml, and checks PyPI. Requires gh auth and the repo secret PYPI_API_TOKEN.

      License

      PyGeoWeaver is licensed under the MIT License. See the LICENSE file for more details.


      Thank you for choosing PyGeoWeaver! We hope this package enhances your geospatial data processing workflows. If you have any questions or need assistance, please refer to the documentation or reach out to us. Happy geospatial processing!

      Subcommands Documentation

      cleanh2db

      • Usage: gw cleanh2db [OPTIONS]

      • Description: Clean and reduce the size of the H2 database used by Geoweaver (fail closed).

        Safe verify-then-promote pipeline:

        1. Stop Geoweaver if it's running
        2. Copy production DB into ~/geoweaver/h2_backups/.../original/
        3. Export to SQL and import into a side rebuilt/ database
        4. Verify rebuilt DB can open and retains WORKFLOW/GWPROCESS/HOST row counts
        5. Promote rebuilt files into production only after verification
        6. Start Geoweaver

        Production is not deleted before import. On interrupt/failure, production is left unchanged or restored from original/. Export/import retries transient lock/timeouts.

      • Options:

        • --h2-jar-path PATH: Path to the H2 database JAR file. If not provided, will use h2-2.2.224.jar in the current directory.
        • --temp-dir PATH: Work/backup directory (default: ~/geoweaver/h2_backups). Registered for crash recovery.
        • --db-path PATH: Path to the H2 database files. If not provided, uses application.properties or ~/h2/gw.
        • --db-username TEXT: Username for the H2 database. Defaults to "geoweaver".
        • --password TEXT: Password for the H2 database. Defaults to the built-in Geoweaver H2 password.
        • --help: Show this message and exit.

        On success the command prints the resulting H2 database size and the safety backup path. After you verify data, free disk with gw cleanh2backups.

      cleanh2backups

      • Usage: gw cleanh2backups [OPTIONS]

      • Description: List or delete H2 safety backups under ~/geoweaver/h2_backups (created by gw cleanh2db).

        With no delete flags, lists each backup directory and its size. After verifying hosts/workflows/processes, remove old backups to reclaim disk.

      • Options:

        • --list: List only
        • --keep N: Keep the N newest backups; delete older ones
        • --all: Delete all backups
        • --path DIR: Delete a specific backup directory (repeatable)
        • --backup-root PATH: Override backup root
        • --dry-run: Show what would be deleted
        • -y / --yes: Skip confirmation
        • --force: Also remove backups marked .in_progress

      create

      • Usage: gw create [OPTIONS] COMMAND [ARGS]...
      • Description: Create commands for Geoweaver.
      • Commands:
        • process: Create a process with given code or file path
          • Options:
            • --lang: Programming language of the process
            • --description: Description of the process
            • --name: Name of the process
            • --code: Process code
            • --file-path: Path to file containing the code
            • --owner: Owner ID (default: "111111")
            • --confidential: Privacy flag (default: false)
        • workflow: Create a workflow with given configuration
          • Options:
            • --description: Workflow description
            • --edges: Workflow edges configuration
            • --name: Workflow name
            • --nodes: Workflow nodes configuration
            • --owner: Owner ID (default: "111111")
            • --confidential: Privacy flag (default: false)
      • Examples:
        # Create a process
        gw create process --lang python --name "my_process" --description "My process" --code "print('Hello')" 
        
        # Create a process from file
        gw create process --lang python --name "file_process" --description "Process from file" --file-path "script.py"
        
        # Create a workflow
        gw create workflow --name "my_workflow" --description "My workflow" --nodes "[...]" --edges "[...]"
        

      detail

      • Usage: gw detail [OPTIONS] COMMAND [ARGS]...
      • Description: Display detailed information about Geoweaver objects.
      • Commands:
        • code: Get the code of a process.
        • host: Display detailed information about a host.
        • process: Display detailed information about a process.
        • workflow: Display detailed information about a workflow.
      • Options:
        • --help: Show help message and exit.
      • Examples:
        gw detail process <process_id>
        gw detail workflow <workflow_id>
        gw detail host <host_id>
        gw detail code <process_id>
        

      export

      • Usage: gw export workflow [OPTIONS] WORKFLOW_ID TARGET_FILE_PATH
      • Description: Exports a workflow to a specified file.
      • Arguments:
        • workflow_id: Geoweaver workflow ID
        • target_file_path: Target file path to save the workflow zip
      • Options:
        • --mode INTEGER: Export mode (default: 4)
          • 1: Workflow only
          • 2: Workflow with process code
          • 3: Workflow with process code and only good history
          • 4: Workflow with process code and all history
        • --unzip: Unzip the exported file
        • --unzip-directory-name TEXT: Specify the directory name when unzipping
      • Example:
        # Export workflow with all history
        gw export workflow my_workflow_id ./my_workflow.zip
        
        # Export workflow and unzip to specific directory
        gw export workflow --unzip --unzip-directory-name my_workflow my_workflow_id ./my_workflow.zip
        

      find

      • Usage: gw find [OPTIONS] COMMAND [ARGS]...
      • Description: Find commands for Geoweaver.
      • Commands:
        • id: Get a process by its ID
          gw find id <process_id>
          
        • language: Get processes by their programming language
          gw find language <programming_language>
          
        • name: Get processes by their name
          gw find name <process_name>
          

      help

      • Usage: gw help [command]
      • Description: Displays help information for Geoweaver commands.
      • Arguments: Optional command name to get specific help

      history

      • Usage: gw history [OPTIONS] COMMAND [ARGS]...
      • Description: History commands for Geoweaver.
      • Commands:
        • get_process: Get list of history for a process using process id.
        • get_workflow: Get list of history for a workflow using workflow id.
        • show: Show history for a workflow or process.
      • Examples:
        # Get history for a specific process
        gw history get_process <process_id>
        
        # Get history for a specific workflow
        gw history get_workflow <workflow_id>
        
        # Show detailed history information
        gw history show <history_id>
        

      import

      • Usage: gw import [OPTIONS] COMMAND [ARGS]...

      • Description: Import commands for Geoweaver.

      • Options:

        • --help: Show this message and exit.
      • Commands:

        • workflow: Import a workflow from a zip file.
          • Usage: gw import workflow <workflow_zip_file_path>
          • Description: Imports a workflow from a zip file.
          • Arguments:
            • workflow_zip_file_path: Path to the Geoweaver workflow zip file

      For detailed usage examples and additional information, please refer to the PyGeoWeaver Documentation.

Metadata

Release files for pygeoweaver 1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygeoweaver 1.4.2
File Size Uploaded Provenance Actions
pygeoweaver-1.4.2.tar.gz 123.3 kB Without provenance Details for pygeoweaver-1.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygeoweaver 1.4.2
File Interpreter ABI Platform Actions
pygeoweaver-1.4.2-py3-none-any.whl Python 3 none any Details for pygeoweaver-1.4.2-py3-none-any.whl

Total release size: 237.2 kB

Release files / pygeoweaver-1.4.2.tar.gz

Download URL pygeoweaver-1.4.2.tar.gz
Size 123.3 kB
Tags Source
SHA-256 checksum
How to use checksums
14422e1f00398da22811ca3e724feec80c1f1950167a0a765006ab4c88ce1d5a
BLAKE2b-256 checksum
How to use checksums
968b283f2536eff1deb082a095a11d8bd86eb5f5640f02002fcba8516d4e3040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pygeoweaver-1.4.2-py3-none-any.whl

Download URL pygeoweaver-1.4.2-py3-none-any.whl
Size 113.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
468772f30932b639fd189f983776092dfcff09c861448fe3f99a862ab76d621a
BLAKE2b-256 checksum
How to use checksums
c4ecd6889414df1bd026f0292f37f40e497c80b47a1c7d371f58c611323910bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pygeoweaver 1.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.4.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page