diff --git a/setup.cfg b/setup.cfg index 8e642ee95db791973b1e8da9c868bc6f15671111..9e3f10d0202a499366a41c3356c559653c55ae50 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,3 +39,6 @@ per-file-ignores = __init__.py:F401 [options.entry_points] console_scripts = caosdb-crawler = caoscrawler.crawl:main + +[options.extras_require] +h5-crawler = h5py >= 3.8 diff --git a/src/caoscrawler/hdf5_converter.py b/src/caoscrawler/hdf5_converter.py new file mode 100644 index 0000000000000000000000000000000000000000..1262aa5572f53b92ede0d531bc35a2a93efd69b8 --- /dev/null +++ b/src/caoscrawler/hdf5_converter.py @@ -0,0 +1,27 @@ +# +# This file is a part of the CaosDB Project. +# +# Copyright (C) 2023 IndiScale GmbH <info@indiscale.com> +# Copyright (C) 2023 Florian Spreckelsen <f.spreckelsen@indiscale.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# + +try: + import h5py +except ModuleNotFoundError: + raise ModuleNotFoundError( + "Couldn't find module h5py. Did you install the crawler package with " + "its optional `h5-crawler` dependency?" + )