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 |
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 |
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
|
Returns:
| Type | Description |
|---|---|
|
|
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 |
None
|
|
delimiter
|
CSV field seperator. |
';'
|
|
dash_is_none
|
If set to |
True
|
Returns:
| Type | Description |
|---|---|
|
|
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 |
|---|---|
|
|
load_excels(pattern=None)
¶
Load multiple excel files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
Globbing pattern (same format as used by |
None
|
Returns:
| Type | Description |
|---|---|
|
|
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 |
|---|---|
|
|
load_peak_maps(pattern=None)
¶
Load multiple peak maps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
Globbing pattern (same as used for |
None
|
Returns:
| Type | Description |
|---|---|
|
|
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 |
|---|---|
|
|
load_tables(pattern=None)
¶
Load multiple tables in emzed format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
Globbing pattern (same format as used by |
None
|
Returns:
| Type | Description |
|---|---|
|
|
save_csv(table, path=None, *, delimiter=';', as_printed=True, overwrite=False)
¶
Save table in csv format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Instance of |
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
|
|
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 |
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 |
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 |
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
|