Python gcode parser
Project description
GcodeParser
A simple gcode parser that takes a string of text and returns a list where each gcode command is seperated into a python object.
The structure of the python object is:
G1 X10 Y-2.5 ; this is a comment
GcodeLine(
command = ('G', 1),
params = {'X': 10, 'Y': -2.5},
comment = 'this is a comment',
)
Install
pip install gcodeparser
Alternatively:
pip install -e "git+https://github.com/AndyEveritt/GcodeParser.git@master#egg=gcodeparser"
Usage
from gcodeparser import GcodeParser
# open gcode file and store contents as variable
with open('my_gcode.gcode', 'r') as f:
gcode = f.read()
GcodeParser(gcode).lines # get parsed gcode lines
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gcodeparser-0.0.1.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gcodeparser-0.0.1.tar.gz.
File metadata
- Download URL: gcodeparser-0.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20d4688587938520fdbb77977845df461d374a3140382994f2eccc24782bd998
|
|
| MD5 |
b42dc5d332d3b19e9a7ebde34de0a14a
|
|
| BLAKE2b-256 |
a2a56ed63bd5048ec6b7841728dce5ac11bad94eab64c32b71c86b595bb042e3
|
File details
Details for the file gcodeparser-0.0.1-py3-none-any.whl.
File metadata
- Download URL: gcodeparser-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3e2bdf67ae03f3143a0dca44fff882bae96b78438a203fe9a98540c9a5a3546
|
|
| MD5 |
ea1ab1bc9fc74c8307655cebed8e97c6
|
|
| BLAKE2b-256 |
aa5887d8eb52b1e54c6809011276ca7d4c9dde4e6665f9dddefbc1ba0385f9a5
|