Python
Parsing
Overview
The parsing module in ducpy
provides functions to read and parse duc files into Python objects. These functions convert the FlatBuffers binary format into structured Python objects that you can easily work with in your code.
Main Functions
Parse Duc File
The main function for parsing a complete duc file:
Parse Individual Components
You can also parse individual components of a duc file:
Parse Duc Elements
Parse App State
Parse Binary Files
Returned Data Structure
When parsing a duc file, you get a dictionary with the following keys:
elements
: A list ofDucElementUnion
objects representing all elements in the fileappState
: AnAppState
object containing application state informationfiles
: ABinaryFiles
object containing any binary files embedded in the duc filetype
: The file type stringversion
: The file version numbersource
: The source of the file
Element Types
The duc format supports several element types, each with specific properties:
- Text elements
- Line elements
- Freedraw elements
- Image elements
- Frame elements
- Group elements
- Magic frame elements
- Iframe elements
Each element type is parsed into a corresponding Python object with appropriate properties.
Edit on GitHub
Last updated on