{"id":37527937,"url":"https://github.com/mauroalderete/gcode-core","last_synced_at":"2026-01-16T08:25:39.131Z","repository":{"id":49367938,"uuid":"504948315","full_name":"mauroalderete/gcode-core","owner":"mauroalderete","description":"Golang library to model and edit G-code commands, blocks from files","archived":false,"fork":false,"pushed_at":"2022-10-01T16:54:44.000Z","size":215,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T10:59:15.263Z","etag":null,"topics":["g-code","gcode","golang","golang-library","library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mauroalderete.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"mauroalderete","custom":"https://cafecito.app/mauroalderete"}},"created_at":"2022-06-18T20:51:50.000Z","updated_at":"2024-10-10T17:02:04.000Z","dependencies_parsed_at":"2023-01-19T01:30:54.506Z","dependency_job_id":null,"html_url":"https://github.com/mauroalderete/gcode-core","commit_stats":null,"previous_names":["mauroalderete/gcode-skew-transform-cli"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/mauroalderete/gcode-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauroalderete%2Fgcode-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauroalderete%2Fgcode-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauroalderete%2Fgcode-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauroalderete%2Fgcode-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauroalderete","download_url":"https://codeload.github.com/mauroalderete/gcode-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauroalderete%2Fgcode-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["g-code","gcode","golang","golang-library","library"],"created_at":"2026-01-16T08:25:38.392Z","updated_at":"2026-01-16T08:25:39.112Z","avatar_url":"https://github.com/mauroalderete.png","language":"Go","funding_links":["https://github.com/sponsors/mauroalderete","https://cafecito.app/mauroalderete"],"categories":[],"sub_categories":[],"readme":"# gcode-core\n\n\u0026nbsp;\n\u003cdiv align=\"center\"\u003e\n\t\n\u003cimg src=\"./.assets/gcode-core-logo.png\" alt=\"logo\" width=\"300\"/\u003e\n\n\u003c/div\u003e\n\n\u003ch4 align=\"center\"\u003eManipulate and edit G-code commands, blocks and files.\u003c/h4\u003e\n\n\u0026nbsp;\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/mauroalderete/gcode-core/blob/main/LICENSE\"\u003e\n\t\u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/mauroalderete/gcode-core/blob/main/CODE_OF_CONDUCT.md\"\u003e\n\t\u003cimg alt=\"Contributor covenant: 2.1\" src=\"https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://semver.org/\"\u003e\n\t\u003cimg alt=\"Semantic Versioning: 2.0.0\" src=\"https://img.shields.io/badge/Semantic--Versioning-2.0.0-a05f79?logo=semantic-release\u0026logoColor=f97ff0\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/mauroalderete/gcode-core\"\u003e\n\t\u003cimg src=\"https://pkg.go.dev/badge/github.com/mauroalderete/gcode-core.svg\" alt=\"Go Reference\"\u003e\n\u003c/a\u003e\n\n[![Tests](https://github.com/mauroalderete/gcode-core/actions/workflows/tests.yml/badge.svg)](https://github.com/mauroalderete/gcode-core/actions/workflows/tests.yml)\n[![CodeQL](https://github.com/mauroalderete/gcode-core/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/mauroalderete/gcode-core/actions/workflows/codeql-analysis.yml)\n[![codecov](https://codecov.io/gh/mauroalderete/gcode-core/branch/main/graph/badge.svg?token=U6MTOGMQFM)](https://codecov.io/gh/mauroalderete/gcode-core)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/mauroalderete/gcode-core.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/mauroalderete/gcode-core/alerts/)\n[![Maintainability](https://api.codeclimate.com/v1/badges/8fb5ba0230e2855815ad/maintainability)](https://codeclimate.com/github/mauroalderete/gcode-core/maintainability)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mauroalderete/gcode-core)](https://goreportcard.com/report/github.com/mauroalderete/gcode-core)\n\n\u003ca href=\"https://github.com/mauroalderete/gcode-core/issues/new/choose\"\u003eReport Bug\u003c/a\u003e\n·\n\u003ca href=\"https://github.com/mauroalderete/gcode-core/issues/new/choose\"\u003eRequest Feature\u003c/a\u003e\n\n\u003ca href=\"https://github.com/mauroalderete/gcode-core/discussions\"\u003e\n\t\u003cimg alt=\"Join the community on GitHub Discussions\" src=\"https://img.shields.io/badge/Join%20the%20community-on%20GitHub%20Discussions-blue\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://twitter.com/intent/tweet?text=👋%20Check%20this%20amazing%20repo%20https://github.com/mauroalderete/gcode-core,%20created%20by%20@_mauroalderete%0A%0A%23DEVCommunity%20%23100DaysOfCode%20%23Golang%20%23gcode\"\u003e\n\t\u003cimg src=\"https://img.shields.io/twitter/url?label=Share%20on%20Twitter\u0026style=social\u0026url=https%3A%2F%2Fgithub.com%2Fatapas%2Fmodel-repo\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://gitter.im/gcode-core/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\n\t\u003cimg src=\"https://badges.gitter.im/gcode-core/community.svg\"\u003e\n\u003c/a\u003e\n\n\u003c/div\u003e\n\n\u0026nbsp;\n# :wave: Introducing `gcode-core`\n`gcode-core` is a Golang library to model, manipulate and edit G-code commands, blocks and files. Easily, you can open gcode files and apply them to all kinds of massive operations that come to mind.\n\n- Do you need to apply skew correction to files before sending to your CNC machine them?\n- Do you wish to insert gcode snippets to change the temperature or a tool regularly?\n- Do you like to verify each gcode line?\n- Or calculate extra info in your files simply?\n\n`gcode-core` gives you a set of interfaces and objects to help you accomplish your goals simplifying manipulating your gcode files at a low level.\n\n# :computer: Use `gcode-core`\n\nSimply add an import statement into your project to start using.\n\nSome like that:\n\n```go\nimport (\n    \"fmt\"\n    \"log\"\n    \"https://github.com/mauroalderete/gcode-core/block/gcodeblock\"\n)\n```\n\nLater, use it:\n\n```go\nfunc main() {\n\t// we define a gcode line to parse\n\tconst source = \"N7 G1 X2.0 Y2.0 F3000.0\"\n\n    // convert a string statement into a gcode block model\n\tblock, err := gcodeblock.Parse(source)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n    // calculate and get the checksum gcode of our new block\n\tgcode, err := b.CalculateChecksum()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n    // show the checksum!\n\tfmt.Printf(\"the gcode checksum is: %s\\n\", gcode)\n\n\t// Output:\n\t// the gcode checksum is: *85\n}\n```\n\nThere are many packages you can import. Some export concrete implementations that you can start to interact with your files speedily. Instead, others export interfaces and constructors that allow you to use them with dependency injection patterns.\n\nPlease, feel free to examine the [`documentation`](https://pkg.go.dev/github.com/mauroalderete/gcode-core) and [`contribute`](CONTRIBUTING.md) by writing any question, suggestion or issue using our [`discussion channels`](https://github.com/mauroalderete/gcode-core/discussions) or creating a [`new issue`](https://github.com/mauroalderete/gcode-core/issues/new/choose).\n\n# :fire: Features\n\nWith `gcode-core` you can do the following\n\n## Model Gcode commands and blocks\n\nIt implements many ways to get gcode or block instances. With them, you can get a summary or modify his values and apply some logic or math operations.\n\n## Validate blocks\n\n- Allow you to review if a block is valid or not\n- Update checksum\n- Change the validation algorithm\n- Add a checksum gcode if your slicer does not do it.\n\n## Manage gcode addressable and gcode unaddressable separately way\n\nMost gcode commands use an address element to add some information about that do it. However, some circumstantial gcode commands do not require an address element like the gcodes `M` or `G` when used without an address value.\n\n`gcode-core` provide interfaces and implementations to handle both situations discriminately.\n\n## Dependency Injection\n\nThe packages provide the interfaces needed you can use to implement within your own dependency injection strategy.\n\n## Customizable interfaces \n\nSometimes the implementations exported maybe not be enough. For these cases, all packages give you interfaces with which you can implement your own 'gcode' and 'block' models or extend them exists.\n\n# :rocket: Upcomming Features\n\n`gcode-core` has all the potential to grow further. Here are some of the upcoming features planned (not in any order),\n\n- ✔️ Handle files.\n- ✔️ Mapping gcode commands and improving validating block.\n- ✔️ Cloning blocks and gcode.\n- ✔️ Convert gcode data types.\n- ✔️ Improve compatibility with [`RFCRS274NGC`](https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3?pub_id=823374).\n\n# :building_construction: How to Set up `gcode-core` for Development?\n\nYou set up `gcode-core` locally with a few easy steps.\n\n1. Clone the repository\n\n```bash\ngit clone https://github.com/mauroalderete/gcode-core\n```\n\n2. Change the working directory\n\n```bash\ncd gcode-core\n```\n\n3. Restore module\n\n```bash\ngo mod tidy\n```\n\n4. You can run all unit tests and examples to check it's working\n\n```bash\ngo test ./...\n```\n\n5. Optionally, if you have godocs installed, You can run a server to access documentation via website at localhost.\n\n```bash\nGOROOT=$GOPATH godoc -http=localhost:9090\n```\n# :hamburger: Built With\n\n- [Golang](https://go.dev/) 1.18\n\n# :shield: License\n\nThis project is licensed under the MIT License - see the [`LICENSE`](LICENSE) file for details.\n\n# :handshake: Contributing to `gcode-core`\n\nAny kind of positive contribution is welcome! Please help us to grow by contributing to the project.\n\nIf you wish to contribute, you can work on any features [listed here](https://github.com/mauroalderete/gcode-core#rocket-upcomming-features) or create one on your own. After adding your code, please send us a Pull Request.\n\n\u003e Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details on our [`CODE OF CONDUCT`](CODE_OF_CONDUCT.md), and the process for submitting pull requests to us.\n\n# :pray: Support\n\nWe all need support and motivation. `gcode-core` is not an exception. Please give this project a :star: start to encourage and show that you liked it. Don't forget to leave a :star: star before you move away.\n\nIf you found the app helpful, consider supporting us with a coffee.\n\n\u0026nbsp;\n\u003cdiv align=\"center\"\u003e\n\u003ca href='https://cafecito.app/mauroalderete' rel='noopener' target='_blank'\u003e\u003cimg srcset='https://cdn.cafecito.app/imgs/buttons/button_6.png 1x, https://cdn.cafecito.app/imgs/buttons/button_6_2x.png 2x, https://cdn.cafecito.app/imgs/buttons/button_6_3.75x.png 3.75x' src='https://cdn.cafecito.app/imgs/buttons/button_6.png' alt='Invitame un café en cafecito.app' /\u003e\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauroalderete%2Fgcode-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauroalderete%2Fgcode-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauroalderete%2Fgcode-core/lists"}