blueprint
Version, currently master branch1 version
- master branchlatestJul 24, 2019
github.com/maxpowa/blueprint.cr
Factorio Blueprint parser written in Crystal
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
blueprint:
github: maxpowa/blueprint.cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.27.2- License
- MIT
- Author
- Max Gurela
Dependencies
This version declares no dependencies.
README
blueprint.cr
Factorio blueprint parsing library written in Crystal. Plans to eventually include a blueprint builder API similar to that of JSON::Builder.
Installation
Add this to your application's shard.yml:
dependencies:
blueprint:
github: maxpowa/blueprint.cr
Usage
# Simple script which demonstrates some usage of Blueprint.parse
# Will output counts for each entity included in the blueprint
require "blueprint"
puts "Paste your blueprint string: "
blueprint_str = gets.not_nil! # Take user input
result = Blueprint.parse(blueprint_str) # Parse to a Blueprint::Blueprint or Blueprint::Book
required_items = {} of String => Int32
if (result.is_a?(Blueprint::Blueprint)) # Check if its a Blueprint::Blueprint
result.entities.not_nil!.map do |entity|
current_count = required_items[entity.name]? || 0
required_items[entity.name] = current_count + 1
end
end
puts required_items
See factorio wiki for type reference, or look in the types directory.
Contributing
- Fork it (https://github.com/maxpowa/blueprint.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- maxpowa Max Gurela - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jul 24, 2019
- Crystal
0.27.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/maxpowa/blueprint.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 1