diff --git a/CHANGELOG.md b/CHANGELOG.md index 0906b48..d98d519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -## [v0.3.2] - 2020-01-022 +## [v0.3.3] - 2020-01-23 + +### Fixed +- Spelling of requester pays (was requestor) + +## [v0.3.2] - 2020-01-22 ### Changed - sat-stac now compatible with Python3 versions < 3.6 () @@ -74,6 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Initial Release [Unreleased]: https://github.com/sat-utils/sat-stac/compare/master...develop +[v0.3.3]: https://github.com/sat-utils/sat-stac/compare/0.3.2...v0.3.3 [v0.3.2]: https://github.com/sat-utils/sat-stac/compare/0.3.1...v0.3.2 [v0.3.1]: https://github.com/sat-utils/sat-stac/compare/0.3.0...v0.3.1 [v0.3.0]: https://github.com/sat-utils/sat-stac/compare/0.2.0...v0.3.0 diff --git a/satstac/item.py b/satstac/item.py index 44ded20..e27717b 100644 --- a/satstac/item.py +++ b/satstac/item.py @@ -134,7 +134,7 @@ def download_assets(self, keys=None, **kwargs): filenames.append(self.download(key, **kwargs)) return filenames - def download(self, key, overwrite=False, path='', filename='${id}', requestor_pays=False): + def download(self, key, overwrite=False, path='', filename='${id}', requester_pays=False): """ Download this key (e.g., a band, or metadata file) from the scene """ asset = self.asset(key) if asset is None: @@ -148,7 +148,7 @@ def download(self, key, overwrite=False, path='', filename='${id}', requestor_pa ext = os.path.splitext(asset['href'])[1] fout = os.path.join(_path, fname + '_' + key + ext) if not os.path.exists(fout) or overwrite: - _filename = utils.download_file(asset['href'], filename=fout, requestor_pays=requestor_pays) + _filename = utils.download_file(asset['href'], filename=fout, requester_pays=requester_pays) else: _filename = fout except Exception as e: diff --git a/satstac/itemcollection.py b/satstac/itemcollection.py index 859d927..59158c1 100644 --- a/satstac/itemcollection.py +++ b/satstac/itemcollection.py @@ -127,15 +127,15 @@ def summary(self, params=[]): txt += ''.join(['{:<25} '.format(s.substitute('${%s}' % p)) for p in params]) + '\n' return txt - def calendar(self): + def calendar(self, group='platform'): """ Get calendar for dates """ date_labels = {} for d in self.dates(): - sensors = self.properties('eo:platform', d) - if len(sensors) > 1: + groups = self.properties(group, d) + if len(groups) > 1: date_labels[d] = 'Multiple' else: - date_labels[d] = sensors[0] + date_labels[d] = groups[0] return terminal_calendar(date_labels) def save(self, filename): diff --git a/satstac/utils.py b/satstac/utils.py index 39a713a..5f96d39 100644 --- a/satstac/utils.py +++ b/satstac/utils.py @@ -52,14 +52,14 @@ def dict_merge(dct, merge_dct, add_keys=True): return dct -def download_file(url, filename=None, requestor_pays=False): +def download_file(url, filename=None, requester_pays=False): """ 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 = {} # check if on s3, if so try to sign it if 's3.amazonaws.com' in url: - signed_url, signed_headers = get_s3_signed_url(url, requestor_pays=requestor_pays) + signed_url, signed_headers = get_s3_signed_url(url, requester_pays=requester_pays) resp = requests.get(signed_url, headers=signed_headers, stream=True) if resp.status_code != 200: resp = requests.get(url, headers=headers, stream=True) @@ -98,7 +98,7 @@ def splitall(path): return allparts -def get_s3_signed_url(url, rtype='GET', public=False, requestor_pays=False, content_type=None): +def get_s3_signed_url(url, rtype='GET', public=False, requester_pays=False, content_type=None): access_key = os.environ.get('AWS_BUCKET_ACCESS_KEY_ID', os.environ.get('AWS_ACCESS_KEY_ID')) secret_key = os.environ.get('AWS_BUCKET_SECRET_ACCESS_KEY', os.environ.get('AWS_SECRET_ACCESS_KEY')) region = os.environ.get('AWS_BUCKET_REGION', os.environ.get('AWS_REGION', 'eu-central-1')) @@ -142,7 +142,7 @@ def getSignatureKey(key, dateStamp, regionName, serviceName): 'x-amz-content-sha256': payload_hash, 'x-amz-date': amzdate } - if requestor_pays: + if requester_pays: headers['x-amz-request-payer'] = 'requester' if public: headers['x-amz-acl'] = 'public-read' diff --git a/satstac/version.py b/satstac/version.py index 73e3bb4..80eb7f9 100644 --- a/satstac/version.py +++ b/satstac/version.py @@ -1 +1 @@ -__version__ = '0.3.2' +__version__ = '0.3.3'