namespace mydata;
table Data {
value:string;
size:uint;
}
table Element {
data:Data;
}
root_type Element;
Running flatc --python -o . example.fbs --python-typing generates a directory mydata/ with an __init__.py, a Data.py and a Element.py.
As the Element references the Data table, it imports the class from that file:
# mydata/Element.py
import flatbuffers
from flatbuffers.compat import import_numpy
from typing import Any
from mydata.Data import Data
from typing import Optional
...
Is there a way, to modify the import statement from mydata.Data import Data to, e.g. from mylibray.mydata.Data import Data, without modifying the original schema files?
Imagine, we have the following schema file:
Running
flatc --python -o . example.fbs --python-typing
generates a directorymydata/
with an__init__.py
, aData.py
and aElement.py
.As the
Element
references theData
table, it imports the class from that file:Is there a way, to modify the import statement
from mydata.Data import Data
to, e.g.from mylibray.mydata.Data import Data
, without modifying the original schema files?