A simple library to read MySQL Workbench MWB files.
- Python 3.7
You can clone the repository and install the package:
$ git clone https://github.com/marianoesteban/pymwb.git
$ cd pymwb
$ python setup.py install
Here is an example that prints the basic contents of an MWB file:
import mwb
example_model = mwb.Model('example_file.mwb')
for schema in example_model.schemas:
print('Schema:', schema.name)
for table in schema.tables:
print('\tTable:', table.name)
for column in table.columns:
print('\t\t' + column.name + ':', column.datatype)
for view in schema.views:
print('\tView:', view.name)
The following features are not yet implemented:
- Primary keys
- Foreign keys
- Relationships
- Column attributes (not null, unique, binary, etc.)
- User types