diff --git a/README.md b/README.md index 45b0d85..e1fda45 100644 --- a/README.md +++ b/README.md @@ -152,4 +152,11 @@ DataTree('None', parent=None) ``` +Example of usage for S3: access +```pycon +url = 's3:///eodata/..../.SAFE' +storage_options = {"anon": False, "client_kwargs": {"endpoint_url": 'https://'+entrypoint_url, 'aws_access_key_id':access_key, + 'aws_secret_access_key':secret_key}} +reader = Sentinel1Reader(url,backend_kwargs={"storage_options": storage_options}) +``` diff --git a/safe_s1/__init__.py b/safe_s1/__init__.py index c707650..8ebc67f 100644 --- a/safe_s1/__init__.py +++ b/safe_s1/__init__.py @@ -1,7 +1,12 @@ -from importlib.metadata import version -from .metadata import Sentinel1Reader - +import traceback +#import safe_s1 +from safe_s1.reader import Sentinel1Reader try: - __version__ = version("safe_s1") + from importlib import metadata +except ImportError: # for Python<3.8 + import importlib_metadata as metadata +try: + __version__ = metadata.version("xarray-safe-s1") except Exception: + print('trace',traceback.format_exc()) __version__ = "999" diff --git a/safe_s1/metadata.py b/safe_s1/reader.py similarity index 100% rename from safe_s1/metadata.py rename to safe_s1/reader.py