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
.
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's sqlite3
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
and payload
, respectively), both of which have just name
and value
columns. However, the payload
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.
payload
table and in the metadata
table are of blob format
. A Binary Large OBject (BLOB)
is basically a collection of binary data stored as a single entity in a database management system, typically images
, audio
or any other multimedia
file and in this case image layers
. I think it can be easily parsed into json
format. I am marking your answer as the correct one. Cheers and thanks for pointing me in the right direction!
Sep 6, 2015 at 17:37
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
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.
.sketch
file data not to convert it. Have been searching on internet for a while now but have come across only framerJs
which is in coffeescript.
Sep 5, 2015 at 14:22