Is your feature request related to a problem? Please describe.
The GRASS Tools API is supposed to make parsing of tool output easier with Python, but it is now harder for g.proj. Flag g is depreciated and this module suggests using format=shell instead, but in Python that returns a ToolResult object that takes more work to parse. The ToolResult can be returned as a dictionary with method .keyval, but the manual page for this tool does not have an example of this.
# Find units with depreciated flag
projection = gs.parse_command("g.proj", flags=["g"])
units = projection.get("units", "units")
# Find units with shell
projection = tools.g_proj(format="shell", flags="p").keyval
units = projection.get("units")
print(units)
Describe the solution you'd like
I suggest adding a format=json option to g.proj for easier parsing. I also suggest adding up to date examples of parsing results with Python to the manual page.
# Find units with JSON
units = tools.g_proj(format="json", flags="p")["units"]
print(units)
Additional context
GRASS 8.5.0 (2026)
Is your feature request related to a problem? Please describe.
The GRASS Tools API is supposed to make parsing of tool output easier with Python, but it is now harder for g.proj. Flag g is depreciated and this module suggests using format=shell instead, but in Python that returns a ToolResult object that takes more work to parse. The ToolResult can be returned as a dictionary with method .keyval, but the manual page for this tool does not have an example of this.
Describe the solution you'd like
I suggest adding a format=json option to g.proj for easier parsing. I also suggest adding up to date examples of parsing results with Python to the manual page.
Additional context
GRASS 8.5.0 (2026)