Skip to content

emzed.io

This module contains multple functions for readin and writing tables and peakmaps in different formats.

If emzed-gui is installed all functions will open file dialogs as fall-back when the caller does not specify file paths.

LocationManager

Persist the last file locations used by the interactive I/O helpers.

get(key)

Return the stored path for an I/O action key.

Parameters:

Name Type Description Default
key

action key such as "load_table" or "save_peak_map".

required

update(key, location)

Store the last-used path for an I/O action key.

Parameters:

Name Type Description Default
key

action key such as "load_table" or "save_peak_map".

required
location

file or folder path to persist.

required

load_csv(path=None, *, delimiter=';', dash_is_none=True)

Load CSV file.

Parameters:

Name Type Description Default
path

Path to the file to load. If not specified and if emzed-gui is installed a user dialog will pop up and ask for the file.

None
delimiter

CSV field delimiter

';'
dash_is_none

If set to True the value - will be interpreted as None (missing value).

True

Returns:

Type Description

emzed.Table

load_csvs(pattern=None, *, delimiter=';', dash_is_none=True)

Load multiple CSV files.

Parameters:

Name Type Description Default
pattern

Globbing pattern (same format as used by glob.glob). If not specified and if emzed-gui is installed a user dialog will pop up and ask for the files. Can also be a folder in case emzed-gui is installed.

None
delimiter

CSV field seperator.

';'
dash_is_none

If set to True the value - will be interpreted as None (missing value).

True

Returns:

Type Description

list of emzed.Table instances

load_excel(path=None)

Load Excel file.

Parameters:

Name Type Description Default
path

Path to the file to load. If not specified and if emzed-gui is installed a user dialog will pop up and ask for the file.

None

Returns:

Type Description

emzed.Table

load_excels(pattern=None)

Load multiple excel files.

Parameters:

Name Type Description Default
pattern

Globbing pattern (same format as used by glob.glob). If not specified and if emzed-gui is installed a user dialog will pop up and ask for the files. Can also be a folder in case emzed-gui is installed.

None

Returns:

Type Description

list of emzed.Table instances

load_peak_map(path=None)

Load peak-map.

Parameters:

Name Type Description Default
path

Path to the file to load. if not specified and if emzed-gui is installed a user dialog will pop up and ask for the file.

None

Returns:

Type Description

emzed.PeakMap

load_peak_maps(pattern=None)

Load multiple peak maps.

Parameters:

Name Type Description Default
pattern

Globbing pattern (same as used for glob.glob). If not specified and if emzed-gui is installed a user dialog will pop up and ask for the files. Can also be a folder in case emzed-gui is installed.

None

Returns:

Type Description

list of emzed.PeakMap instances

load_table(path=None)

Load table in emzed format.

Parameters:

Name Type Description Default
path

Path to the file to load. if not specified and if emzed-gui is installed a user dialog will pop up and ask for the file.

None

Returns:

Type Description

emzed.Table

load_tables(pattern=None)

Load multiple tables in emzed format.

Parameters:

Name Type Description Default
pattern

Globbing pattern (same format as used by glob.glob). If not specified and if emzed-gui is installed a user dialog will pop up and ask for the files. Can also be a folder in case emzed-gui is installed.

None

Returns:

Type Description

list of emzed.Table instances

save_csv(table, path=None, *, delimiter=';', as_printed=True, overwrite=False)

Save table in csv format.

Parameters:

Name Type Description Default
table

Instance of emzed.Table.

required
path

Target file location. If not specified and if emzed-gui is installed a user dialog will pop up asking for the destination.

None
delimiter

CSV format field separator.

';'
as_printed

Uses specified table formats if set to True else all cells (also the invisible cells with format set to None) will be saved in standard string representation.

True
overwrite

Enforce overwriting if file already exists.

False

save_excel(table, path=None, *, overwrite=False)

Save table in excel format.

Parameters:

Name Type Description Default
table

Instance of emzed.Table.

required
path

Target file location. If not specified and if emzed-gui is installed a user dialog will pop up asking for the destination.

None
overwrite

Enforce overwriting if file already exists.

False

save_peak_map(peakmap, path=None, *, overwrite=False)

Save peak map.

Parameters:

Name Type Description Default
peakmap

Instance of emzed.PeakMap.

required
path

Target file location. If not specified and if emzed-gui is installed a user dialog will pop up asking for the destination.

None
overwrite

Enforce overwriting if file already exists.

False

save_table(table, path=None, *, overwrite=False)

Save table in emzed format.

Parameters:

Name Type Description Default
table

Instance of emzed.Table.

required
path

Target file location. If not specified and if emzed-gui is installed a user dialog will pop up asking for the destination.

None
overwrite

Enforce overwriting if file already exists.

False