Skip to main content

XGML

XGML: eXtensible G-code Markup Language, the lightweight markup language specifically designed for easier prototyping of G-Code, without the complex G commands. Simple tags, no closing tag boilerplate from XML and others (</>).

What does it solve?

It solves having to read clunky G-code, let alone actually... understand it at the same efficiency you would understand XGML. It is also an easy markup language to test 3D-printers, make complex patterns, for people who... just don't have well-established experience with 3D modelling.

Why a Markup Language?

Markup languages are really lightweight, declarative, and serve their simple purposes well.

How to use XGML?

  • Installation

Run:

pip install xgml
  • Transpiling XGML scripts

If cloning from GitHub, just copy the parse/xgmlparse.py file over to your preferred directory.

Run:

xgml FILENAME.xgml
# -- OR --
python3 xgmlparse.py FILENAME.xgml 
# Second option will be applied if you cloned this repository.
# File is found with the same name, with the .gcode extension.

What 3D printers does it support?

I'm a WASP enthusiast. so the coordinate system is exactly like the one in their printers, though it supports any 3D printer that can process standard Marlin G-Code.

** Two things to keep in mind...

• Print bed size might not match up to the scripts coordinates. Double check before loading onto the printer.

• Some printers require complex start codes, e.g. Bambu Lab X1C

Try it out!

Here, I've written some XGML code (also found here at test/layers.xgml)

<module XGML_3D_TEST_PRINT
    <var print_bed_temp: 60.0>
    <var print_noz_temp: 210.0>
    <var circle_radius: 12.5>
    <var total_layers: 4>

    <temperature nozzle:print_noz_temp bed:print_bed_temp end>
    <fan speed:255 end>

    <path @f4000 end>
    <path x:0.0 y:0.0 z:0.3 e:0.0 end>
    <path x:10.0 y:10.0 z:0.3 e:1.25 end>

    <loop @for total_layers @zstep 0.4
        ; This circle will automatically print higher on every single pass
        <polygon @PREDEF CIRCLE r:circle_radius end>
        
        ; A travel and extrusion path inside the layer loop
        <path x:30.0 y:30.0 e:2.5 end>
        
        ; This square will stack right along with the circle
        <polygon @PREDEF SQUARE size:20.0 end>
    end>

    <fan speed:0 end>
    <temperature nozzle:0.0 bed:0.0 end>
end>

License

This project is licensed under the Apache License 2.0. Feel free to use, modify, distribute, and build upon this core engine for both personal and commercial 3D printing workflows! See the source headers and the LICENSE for more details.

Metadata

Release files for xgml 15.0.0

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

Source distribution (sdist)

Source distribution for xgml 15.0.0
File Size Uploaded Provenance Actions
xgml-15.0.0.tar.gz 9.0 kB Without provenance Details for xgml-15.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.8 kB

Release files / xgml-15.0.0.tar.gz

Download URL xgml-15.0.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
519adb8ff1da49a2a87db85f9f67b0a3ab37a15e9d3839e6e798c7f7c92fcdd8
BLAKE2b-256 checksum
How to use checksums
9e0b68d9bec80222aa83da3a600dec4edd866247633ae49d9b5d5fe31ab25982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / xgml-15.0.0-py3-none-any.whl

Download URL xgml-15.0.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac5c920f945cd1ea4bd12c56b0e5c9bc240a0c72d29dd131b7a67cf84793e1f0
BLAKE2b-256 checksum
How to use checksums
2621e4c922c043e3fa326776d5e80df895c37fd28922bc6c01f99c4122dc2e87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for xgml 15.0.0

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.

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