Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-sat-stac for openSUSE:Factory 
checked in at 2022-10-08 01:26:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sat-stac (Old)
 and      /work/SRC/openSUSE:Factory/.python-sat-stac.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-sat-stac"

Sat Oct  8 01:26:02 2022 rev:2 rq:1008863 version:0.4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-sat-stac/python-sat-stac.changes  
2020-08-17 14:40:46.094591904 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-sat-stac.new.2275/python-sat-stac.changes    
    2022-10-08 01:26:29.038402907 +0200
@@ -1,0 +2,13 @@
+Fri Oct  7 15:22:59 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to version 0.4.1
+  Added
+  * User can now provide custom headers to download function
+  * id and description keywords added to itemcollection.save() and 
itemcollection.geojson() for user to supply values to save single file STAC
+  Changed
+  * Allow reading in of ItemCollections without collections
+  * Default STAC_VERSION updated to 1.0.0-beta.2
+  Fixed
+  * Saved ItemCollections now adhere to STAC single-file-stac spec 
+
+-------------------------------------------------------------------

Old:
----
  sat-stac-0.4.0.tar.gz

New:
----
  sat-stac-0.4.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-sat-stac.spec ++++++
--- /var/tmp/diff_new_pack.osAz3T/_old  2022-10-08 01:26:29.450403851 +0200
+++ /var/tmp/diff_new_pack.osAz3T/_new  2022-10-08 01:26:29.454403861 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-sat-stac
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 %define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-sat-stac
-Version:        0.4.0
+Version:        0.4.1
 Release:        0
 Summary:        A library for reading and working with Spatio-Temporal Asset 
Catalogs
 License:        MIT
@@ -34,7 +34,7 @@
 Requires:       python-python-dateutil >= 2.7.5
 Requires:       python-requests >= 2.19.1
 Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
 BuildArch:      noarch
 %python_subpackages
 

++++++ sat-stac-0.4.0.tar.gz -> sat-stac-0.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sat-stac-0.4.0/PKG-INFO new/sat-stac-0.4.1/PKG-INFO
--- old/sat-stac-0.4.0/PKG-INFO 2020-06-12 18:01:17.000000000 +0200
+++ new/sat-stac-0.4.1/PKG-INFO 2021-01-25 06:02:46.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: sat-stac
-Version: 0.4.0
+Version: 0.4.1
 Summary: A Python library for working with Spatio-Temporal Asset Catalogs 
(STAC)
 Home-page: https://github.com/sat-utils/sat-stac.git
 Author: Matthew Hanson (matthewhanson)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sat-stac-0.4.0/sat_stac.egg-info/PKG-INFO 
new/sat-stac-0.4.1/sat_stac.egg-info/PKG-INFO
--- old/sat-stac-0.4.0/sat_stac.egg-info/PKG-INFO       2020-06-12 
18:01:17.000000000 +0200
+++ new/sat-stac-0.4.1/sat_stac.egg-info/PKG-INFO       2021-01-25 
06:02:46.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: sat-stac
-Version: 0.4.0
+Version: 0.4.1
 Summary: A Python library for working with Spatio-Temporal Asset Catalogs 
(STAC)
 Home-page: https://github.com/sat-utils/sat-stac.git
 Author: Matthew Hanson (matthewhanson)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sat-stac-0.4.0/satstac/catalog.py 
new/sat-stac-0.4.1/satstac/catalog.py
--- old/sat-stac-0.4.0/satstac/catalog.py       2020-06-12 18:00:07.000000000 
+0200
+++ new/sat-stac-0.4.1/satstac/catalog.py       2021-01-25 06:02:04.000000000 
+0100
@@ -4,7 +4,7 @@
 from .version import __version__
 from .thing import Thing, STACError
 
-STAC_VERSION = os.getenv('STAC_VERSION', '1.0.0-beta.1')
+STAC_VERSION = os.getenv('STAC_VERSION', '1.0.0-beta.2')
 
 
 class Catalog(Thing):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sat-stac-0.4.0/satstac/item.py 
new/sat-stac-0.4.1/satstac/item.py
--- old/sat-stac-0.4.0/satstac/item.py  2020-06-12 18:00:07.000000000 +0200
+++ new/sat-stac-0.4.1/satstac/item.py  2021-01-25 06:02:04.000000000 +0100
@@ -125,7 +125,7 @@
             filenames.append(self.download(key, **kwargs))
         return filenames
 
-    def download(self, key, overwrite=False, 
filename_template=FILENAME_TEMPLATE, requester_pays=False):
+    def download(self, key, overwrite=False, 
filename_template=FILENAME_TEMPLATE, requester_pays=False, headers={}):
         """ Download this key (e.g., a band, or metadata file) from the scene 
"""
         asset = self.asset(key)
         if asset is None:
@@ -135,7 +135,7 @@
         filename = self.get_path(filename_template) + '_' + key + ext
         if not os.path.exists(filename) or overwrite:
             try:
-                utils.download_file(asset['href'], filename=filename, 
requester_pays=requester_pays)
+                utils.download_file(asset['href'], filename=filename, 
requester_pays=requester_pays, headers=headers)
             except Exception as e:
                 filename = None
                 logger.error('Unable to download %s: %s' % (asset['href'], 
str(e)))
@@ -169,9 +169,9 @@
             'links': links,
             'assets': {}
         }
-        return Item(item)        
+        return Item(item)
     '''
 
 # import and end of module prevents problems with circular dependencies.
 # Catalogs use Items and Items use Collections (which are Catalogs)
-from .collection import Collection
\ No newline at end of file
+from .collection import Collection
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sat-stac-0.4.0/satstac/itemcollection.py 
new/sat-stac-0.4.1/satstac/itemcollection.py
--- old/sat-stac-0.4.0/satstac/itemcollection.py        2020-06-12 
18:00:07.000000000 +0200
+++ new/sat-stac-0.4.1/satstac/itemcollection.py        2021-01-25 
06:02:04.000000000 +0100
@@ -3,6 +3,7 @@
 import requests
 
 from logging import getLogger
+from .catalog import STAC_VERSION
 from .collection import Collection
 from .item import Item
 from .thing import STACError
@@ -55,7 +56,7 @@
                 data = json.loads(data)
             else:
                 raise STACError('%s does not exist locally' % filename)
-        collections = [Collection(col) for col in data['collections']]
+        collections = [Collection(col) for col in data.get('collections', [])]
         items = [Item(feature) for feature in data['features']]
         return cls(items, collections=collections)
 
@@ -129,18 +130,23 @@
                 txt += ''.join([f"{vals[i]:{w[i]}}" for i in range(len(w))]) + 
'\n'
         return txt
 
-    def save(self, filename):
+    def save(self, filename, **kwargs):
         """ Save scene metadata """
         with open(filename, 'w') as f:
-            f.write(json.dumps(self.geojson()))
+            f.write(json.dumps(self.geojson(**kwargs)))
 
-    def geojson(self):
+    def geojson(self, id='STAC', description='Single file STAC'):
         """ Get Items as GeoJSON FeatureCollection """
         features = [s._data for s in self._items]
         geoj = {
+            'id': id,
+            'description': description,
+            'stac_version': STAC_VERSION,
+            'stac_extensions': ['single-file-stac'],
             'type': 'FeatureCollection',
             'features': features,
             'collections': [c._data for c in self._collections],
+            'links': []
         }
         return geoj
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sat-stac-0.4.0/satstac/utils.py 
new/sat-stac-0.4.1/satstac/utils.py
--- old/sat-stac-0.4.0/satstac/utils.py 2020-06-12 18:00:07.000000000 +0200
+++ new/sat-stac-0.4.1/satstac/utils.py 2021-01-25 06:02:04.000000000 +0100
@@ -53,11 +53,10 @@
     return dct
 
 
-def download_file(url, filename=None, requester_pays=False):
+def download_file(url, filename=None, requester_pays=False, headers={}):
     """ Download a file as filename """
     filename = os.path.basename(url) if filename is None else filename
     logger.info('Downloading %s as %s' % (url, filename))
-    headers = {}
     _path = os.path.dirname(filename)
     if not os.path.exists(_path):
         mkdirp(_path)
@@ -67,6 +66,9 @@
         resp = requests.get(signed_url, headers=signed_headers, stream=True)
         if resp.status_code != 200:
             resp = requests.get(url, headers=headers, stream=True)
+    elif 'eosdis.nasa.gov' in url:
+        url = url.replace('/archive/', '/api/v2/content/archives/')
+        resp = requests.get(url, headers=headers, stream=True)
     else:
         resp = requests.get(url, headers=headers, stream=True)
     if resp.status_code != 200:
@@ -77,7 +79,6 @@
                 f.write(chunk)
     return filename
 
-
 def mkdirp(path):
     """ Recursively make directory """
     if not os.path.isdir(path) and path != '':
@@ -165,7 +166,7 @@
     signature = hmac.new(signing_key, string_to_sign.encode('utf-8'), 
hashlib.sha256).hexdigest()
     authorization_header = algorithm + ' ' + 'Credential=' + access_key + '/' 
+ credential_scope + ', ' \
         + 'SignedHeaders=' + signed_headers + ', ' + 'Signature=' + signature
-    
+
     request_url = 'https://%s%s' % (host, canonical_uri)
     headers['Authorization'] = authorization_header
     if content_type is not None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sat-stac-0.4.0/satstac/version.py 
new/sat-stac-0.4.1/satstac/version.py
--- old/sat-stac-0.4.0/satstac/version.py       2020-06-12 18:00:07.000000000 
+0200
+++ new/sat-stac-0.4.1/satstac/version.py       2021-01-25 06:02:04.000000000 
+0100
@@ -1 +1 @@
-__version__ = '0.4.0'
+__version__ = '0.4.1'

Reply via email to