dcclib.extraction ¶
DCCFile
dataclass
¶
DCCFile(name: list[StringWithLang], file_name: str, mime_type: str, data_base64: str, ring: Ring)
Dataclass that represents a file in the DCC.
decode_data_base64 ¶
decode_data_base64() -> bytes
Decode the base64 data.
| Returns: |
|
|---|
DCCFunction
dataclass
¶
DCCFunction(name: str, expression: str | Expr, variables: dict[str, Value], bound_variables: set[str])
Bases: Generic[T]
Represents a named, parameterised DCC formula.
combinations
property
¶
combinations: list[Any]
Return one lambdified function per evaluation step (one per combination index).
The number of entries matches the number of results "evaluate()" would return.
Extractable ¶
Bases: ABC
Abstract base class for classes that can extract information.
FileExtractor ¶
FileExtractor(xml_tree: etree.Element)
Bases: Constructible, Extractable
Class to extract files from a DCC XML file.
extract ¶
extract() -> list[DCCFile]
Extract files from the DCC XML.
| Returns: |
|
|---|
from_file
classmethod
¶
from_file(path: str)
Create a FileExtractor from a DCC XML file path.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_str
classmethod
¶
from_str(xml: str)
Create a FileExtractor from a DCC XML string.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_tree
classmethod
¶
from_tree(tree: etree.Element)
Create a FileExtractor from an etree.Element tree.
| Parameters: |
|
|---|
| Returns: |
|
|---|
FormulaExtractor ¶
FormulaExtractor(element: etree.Element)
Bases: Constructible, Extractable
extract ¶
extract() -> list[DCCFunction[DccQuantityType]]
Extract formulas from the XML.
| Returns: |
|
|---|
from_file
classmethod
¶
from_file(path: str)
Create a FormulaExtractor from a file path.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_str
classmethod
¶
from_str(xml: str)
Create a FormulaExtractor from a string.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_tree
classmethod
¶
from_tree(tree: etree.Element)
Create a FormulaExtractor from an ElementTree.
| Parameters: |
|
|---|
| Returns: |
|
|---|
extractable ¶
files ¶
DCCFile
dataclass
¶
DCCFile(name: list[StringWithLang], file_name: str, mime_type: str, data_base64: str, ring: Ring)
Dataclass that represents a file in the DCC.
decode_data_base64 ¶
decode_data_base64() -> bytes
Decode the base64 data.
| Returns: |
|
|---|
FileExtractor ¶
FileExtractor(xml_tree: etree.Element)
Bases: Constructible, Extractable
Class to extract files from a DCC XML file.
extract ¶
extract() -> list[DCCFile]
Extract files from the DCC XML.
| Returns: |
|
|---|
from_file
classmethod
¶
from_file(path: str)
Create a FileExtractor from a DCC XML file path.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_str
classmethod
¶
from_str(xml: str)
Create a FileExtractor from a DCC XML string.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_tree
classmethod
¶
from_tree(tree: etree.Element)
Create a FileExtractor from an etree.Element tree.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Ring ¶
Bases: Enum
Enum for that represents the location of the element in the DCC.
files ¶
DCCFile
dataclass
¶
DCCFile(name: list[StringWithLang], file_name: str, mime_type: str, data_base64: str, ring: Ring)
Dataclass that represents a file in the DCC.
decode_data_base64 ¶
decode_data_base64() -> bytes
Decode the base64 data.
| Returns: |
|
|---|
FileExtractor ¶
FileExtractor(xml_tree: etree.Element)
Bases: Constructible, Extractable
Class to extract files from a DCC XML file.
extract ¶
extract() -> list[DCCFile]
Extract files from the DCC XML.
| Returns: |
|
|---|
from_file
classmethod
¶
from_file(path: str)
Create a FileExtractor from a DCC XML file path.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_str
classmethod
¶
from_str(xml: str)
Create a FileExtractor from a DCC XML string.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_tree
classmethod
¶
from_tree(tree: etree.Element)
Create a FileExtractor from an etree.Element tree.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Ring ¶
Bases: Enum
Enum for that represents the location of the element in the DCC.
StringWithLang
dataclass
¶
StringWithLang(value: str, lang: str)
Dataclass that represents a string with a language.