Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/pyexcel_ods3/__init__.py : 50%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2 pyexcel_ods3
3 ~~~~~~~~~~~~~~~~~~~
5 The lower level ods file format handler using ezodf
7 :copyright: (c) 2015-2017 by Onni Software Ltd & its contributors
8 :license: New BSD License
9"""
10# flake8: noqa
11# this line has to be place above all else
12# because of dynamic import
13from pyexcel_io.plugins import IOPluginInfoChain
14from pyexcel_io.io import (
15 get_data as read_data,
16 isstream,
17 store_data as write_data,
18)
20__FILE_TYPE__ = "ods"
21IOPluginInfoChain(__name__).add_a_reader(
22 relative_plugin_class_path="odsr.ODSBook",
23 file_types=[__FILE_TYPE__],
24 stream_type="binary",
25).add_a_writer(
26 relative_plugin_class_path="odsw.ODSWriter",
27 file_types=[__FILE_TYPE__],
28 stream_type="binary",
29)
32def save_data(afile, data, file_type=None, **keywords):
33 """standalone module function for writing module supported file type"""
34 if isstream(afile) and file_type is None:
35 file_type = __FILE_TYPE__
36 write_data(afile, data, file_type=file_type, **keywords)
39def get_data(afile, file_type=None, **keywords):
40 """standalone module function for reading module supported file type"""
41 if isstream(afile) and file_type is None:
42 file_type = __FILE_TYPE__
43 return read_data(afile, file_type=file_type, **keywords)