How can I parse .sketch
files generated by sketch – mac application?
I know that psd_tools can be used to parse .psd
files generated in Adobe Photoshop
.
How can I parse .sketch
files generated by sketch – mac application?
I know that psd_tools can be used to parse .psd
files generated in Adobe Photoshop
.
3
Answers
Especially as I am unfamiliar with Sketch I do not know of any equivalents to psd_tools. However, this question might help you. Otherwise, you might need to create your own parser.
I don’t have any experience with Sketch, but I downloaded a sample
.sketch
file and it turned out to be an “SQLite 3.x database”. This means you can open it with python’ssqlite3
module.As it happens I had some code lying around that I wrote to inspect another sqlite database, so I took a look: It contains a metadata table and a “payload” table (called
metadata
andpayload
, respectively), both of which have justname
andvalue
columns. However, thepayload
table has just one row, and in both tables the values seem to be containers in some other format I don’t recognize. So although sqlite3 is the file format, it appears that it is just the outer layer of the onion.Edit:
The new sketch file format (> 43) is super friendly.
It’s actually a zip folder in which you have the assets and json files which describe the contents.
http://sketchplugins.com/d/87-new-file-format-in-sketch-43