Skip to main content

Parse, format, lint, and edit GMAT mission scripts from Python — a tree-sitter grammar and tooling.

Project description

gmat-script

Parse, format, lint, and edit GMAT .script mission files from Python — built on a tree-sitter grammar. The whole stack operates on script text; nothing here requires a GMAT install.

Today it ships the parser and the gmat-script parse command-line tool. The typed AST and mutation API, the canonical formatter, the linter, and the editor tooling build on top of the same tree as they land.

Install

pip install gmat-script

gmat-script supports Python 3.10, 3.11, and 3.12. The wheel bundles a precompiled grammar, so the install needs no C or Node toolchain — and never GMAT.

Quick start

from gmat_script import parse

tree = parse("Create Spacecraft Sat\nSat.SMA = 7000\n")

tree.has_errors      # False — the script is well-formed
tree.to_source()     # round-trips byte-for-byte to the input

parse never raises on malformed input: it returns a tree carrying ERROR / MISSING nodes localised to the broken construct, surfaced through tree.errors. The same engine drives the CLI, a fast, install-free syntax gate for CI:

$ gmat-script parse mission.script        # prints the syntax tree; exits non-zero on a syntax error
$ gmat-script parse --json mission.script  # machine-readable {file, ok, errors} report

The grammar surface

The tree-sitter grammar parses GMAT scripts (.script) and GmatFunctions (.gmf) — the same grammar for both — and re-emits any input byte-for-byte, comments and layout included. It is a deliberately permissive superset: Create <Type> <name> accepts any resource type and unknown command keywords parse as generic command nodes, so a new resource or command never needs a grammar change. The acceptance bar is concrete: every one of the 162 .script and 9 .gmf files shipped with NASA GMAT R2026a parses with zero errors and round-trips exactly.

See the grammar surface reference for the node taxonomy and the covered / deferred constructs.

The GMAT-free guarantee

Reading, checking, formatting, and transforming a script needs only this package — never a GMAT install. pip install gmat-script never pulls in, requires, or looks for GMAT or gmatpy; the only runtime dependency is tree-sitter. (GMAT is used at build time only, to generate the field catalogue that later semantic tooling will check against.)

GMAT version

The grammar targets GMAT R2026a. Because it never enumerates resource types or command keywords, parsing is effectively version-independent — scripts from other releases parse too. Semantics that do vary by release (valid field names, enums, defaults) belong to the later linter and are scoped to R2026a.

What gmat-script is not

  • Not a propagator or astrodynamics engine. It reads and transforms script text; it computes no orbits and models no physics.
  • Not a mission runner. Running a script is GMAT's job — gmat-script does no execution.
  • Not an engine-dependent validator. "Does it parse" is a structural question answered here; "does it run / converge" is a different question that needs GMAT.

Documentation

Full documentation — getting started, the grammar surface, the parse CLI, the error-reporting model, and the API reference — is at astro-tools.github.io/gmat-script.

License

MIT — part of the astro-tools organization.

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

gmat_script-0.1.0.tar.gz (319.4 kB view details)

Uploaded Source

Built Distributions

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

gmat_script-0.1.0-cp310-abi3-win_amd64.whl (27.2 kB view details)

Uploaded CPython 3.10+Windows x86-64

gmat_script-0.1.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (38.0 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

gmat_script-0.1.0-cp310-abi3-macosx_11_0_arm64.whl (25.0 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

gmat_script-0.1.0-cp310-abi3-macosx_10_9_x86_64.whl (24.1 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file gmat_script-0.1.0.tar.gz.

File metadata

  • Download URL: gmat_script-0.1.0.tar.gz
  • Upload date:
  • Size: 319.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gmat_script-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d44a208681800a8147ea3b6c399a4a14f7a25707995c256ad8ff430242c14df0
MD5 e1b4e5463af4c6ca15b17f471835e7a9
BLAKE2b-256 e33fc77fecb11d14581375c269101c36627a23c20bff6fe154c05e93ea82cd2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmat_script-0.1.0.tar.gz:

Publisher: release.yml on astro-tools/gmat-script

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmat_script-0.1.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: gmat_script-0.1.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gmat_script-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c3a345faec0e8187a658fe4f31fe57f33583a1f625f8adc992f69ba1d465876e
MD5 3de4bac4fdc18f7e87203f51aa33854c
BLAKE2b-256 5e462a4ef1241804c736e06ecaba1360331c693a83256b32078111bf989ff81d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmat_script-0.1.0-cp310-abi3-win_amd64.whl:

Publisher: release.yml on astro-tools/gmat-script

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmat_script-0.1.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for gmat_script-0.1.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 1b0cc12e8f75650a5d1340af51d8a1a2c7a98921218715254524d3b2600be4e0
MD5 bce5b4d7090e5c7219bc80aa4a56123e
BLAKE2b-256 fbe1a793cc4b332ef02a424eeacbc11a9838fc744d464b2b2a8c7251199a5ec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmat_script-0.1.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on astro-tools/gmat-script

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmat_script-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gmat_script-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 592a0c9f760f5f72f47cac14f679cafc3bdb71993e8197f727764132eaba05a1
MD5 0e49bd4078c5e52ab25d70e347ae2cbe
BLAKE2b-256 c744c0d1166be6d5732c543e9f981f96c56db0b09534838c2382c330e2477d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmat_script-0.1.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on astro-tools/gmat-script

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmat_script-0.1.0-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gmat_script-0.1.0-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b3631782a88567abf2d58eecb8b25dad1849d5e67c8dd1ad5ba3d4b101398135
MD5 ae5d045efd8b45c6edb5ac14aac81dcc
BLAKE2b-256 a4cbbecd3486524ac31d34ef15354721872d8680c22c021b9d63a2195a164837

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmat_script-0.1.0-cp310-abi3-macosx_10_9_x86_64.whl:

Publisher: release.yml on astro-tools/gmat-script

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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