Conversion Functions

lfview.client.convert.omf.view_to_omf(view, filename='view.omf')

Save a View as an OMF file

All object types, data/texture types, and legends are supported. Only custom colormaps are unsupported due to limitations of OMF v1.

Input: view - Valid View instance; see lfview.resources.manifests.manifests.View filename - Path and filename for output OMF file (default: ‘view.omf’)`

lfview.client.convert.omf.omf_to_view(omf_file)

Translate an OMF file into a View

Input: omf_file - Valid OMF file or instance of OMF project; see omf.base.Project

Example Usage

If you wish to export your data from View into an OMF file, first ensure you have the latest version of the View API client:

pip install --upgrade lfview-api-client

Then, obtain your API key by logging in to https://view.seequent.com then visiting https://view.seequent.com/generate_api_key

Next, in Python:

>>> from lfview.client import Session
>>> from lfview.client.convert import view_to_omf
>>> session = Session(<YOUR-API-KEY>)
>>> view = session.download(<YOUR-VIEW-URL>)
>>> view_to_omf(view, filename='output.omf')

That’s it; output.omf contains your View data. If you want to visually validate the contents of the OMF file you may round-trip the data by uploading back to View:

>>> from lfview.client import Session
>>> from lfview.client.convert import omf_to_view
>>> session = Session(<YOUR-API-KEY>)
>>> view = omf_to_view('output.omf')
>>> view_url = session.upload(view)