Skip to content

Python development

Joachim Metz edited this page Jul 15, 2022 · 2 revisions

libfvde comes with Python-bindings named pyfvde.

Below are examples how use pyfvde. They assume you have a working version of pyfvde on your system. To build pyfvde see Building.

Import

To be able to use pyfvde in your Python scripts add the following import:

import pyfvde

Get version

The get_version() module function can be used to retrieve the version of the pyfvde.

pyfvde.get_version()

This will return a textual string (Unicode) that contains the libfvde version. Since pyfvde is a wrapper around libfvde it does not have a separate version.

Open volume

Open a volume by path

fvde_volume = pyfvde.volume()

fvde_volume.open("image.raw")

...

fvde_volume.close()

The explicit call to fvde_volume.close() is not required. Close only must be called once all operations on the volume have been completed.

Open a volume using a file-like object

file_object = open("image.raw", "rb")

fvde_volume = pyfvde.volume()

fvde_volume.open_file_object(file_object)

...

fvde_volume.close()

The explicit call to fvde_volume.close() is not required. Close only must be called once all operations on the volume have been completed and will not close the file-like object itself.

Also see

import pyfvde

help(pyfvde)
help(pyfvde.volume)
Clone this wiki locally