diff --git a/README.md b/README.md index a410bbe..66587f3 100644 --- a/README.md +++ b/README.md @@ -570,6 +570,10 @@ A simple setup would be ## Changelog +### v0.8.3 +- Fixed bundle parsing +- Updated based bundles + ### v0.8.2 - [Pull request 48](https://github.com/tyson-swetnam/porder/pull/48) - fixes typos and equations for bandmath and includes additional reference information diff --git a/dist/porder-0.8.2.tar.gz b/dist/porder-0.8.2.tar.gz deleted file mode 100644 index 988def7..0000000 Binary files a/dist/porder-0.8.2.tar.gz and /dev/null differ diff --git a/dist/porder-0.8.2-py3-none-any.whl b/dist/porder-0.8.3-py3-none-any.whl similarity index 54% rename from dist/porder-0.8.2-py3-none-any.whl rename to dist/porder-0.8.3-py3-none-any.whl index ecc5262..d8345e6 100644 Binary files a/dist/porder-0.8.2-py3-none-any.whl and b/dist/porder-0.8.3-py3-none-any.whl differ diff --git a/dist/porder-0.8.3.tar.gz b/dist/porder-0.8.3.tar.gz new file mode 100644 index 0000000..76452e0 Binary files /dev/null and b/dist/porder-0.8.3.tar.gz differ diff --git a/docs/changelog.md b/docs/changelog.md index 7009fea..04e8ab0 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,9 @@ # Changelog +### v0.8.3 +- Fixed bundle parsing +- Updated based bundles + ### v0.8.2 - [Pull request 48](https://github.com/tyson-swetnam/porder/pull/48) - fixes typos and equations for bandmath and includes additional reference information diff --git a/porder/__init__.py b/porder/__init__.py index 306f646..33602eb 100644 --- a/porder/__init__.py +++ b/porder/__init__.py @@ -2,4 +2,4 @@ __author__ = "Samapriya Roy" __email__ = "samapriya.roy@gmail.com" -__version__ = "0.8.2" +__version__ = "0.8.3" diff --git a/porder/bundles.json b/porder/bundles.json index 3a20f30..62f30d0 100644 --- a/porder/bundles.json +++ b/porder/bundles.json @@ -107,39 +107,6 @@ ] } }, - "analytic_5b": { - "name": "Analytic Image", - "description": "Radiometrically-calibrated analytic image stored as 16-bit scaled radiance", - "bands": "all", - "rectification": "orthorectified", - "radiometry": "at-sensor", - "fileType": "GeoTIFF", - "auxiliaryFiles": "udm", - "assets": { - "PSOrthoTile": [ - "analytic_5b", - "analytic_5b_xml", - "udm" - ] - } - }, - "analytic_5b_udm2": { - "name": "Analytic Image", - "description": "Radiometrically-calibrated analytic image stored as 16-bit scaled radiance. Includes udm2", - "bands": "all", - "rectification": "orthorectified", - "radiometry": "at-sensor", - "fileType": "GeoTIFF", - "auxiliaryFiles": "udm and udm2", - "assets": { - "PSOrthoTile": [ - "analytic_5b", - "analytic_5b_xml", - "udm", - "udm2" - ] - } - }, "visual": { "name": "Visual", "description": "Orthorectified product, visually enhanced for optimal appearance", @@ -369,16 +336,6 @@ "udm", "analytic_xml" ], - "PSOrthoTile": [ - "analytic_sr", - "udm", - "analytic_xml" - ], - "REOrthoTile": [ - "analytic_sr", - "udm", - "analytic_xml" - ], "MOD09GQ": [ "analytic_num_observations", "analytic_orbit_pnt", @@ -463,12 +420,6 @@ "analytic_xml", "udm", "udm2" - ], - "PSOrthoTile": [ - "analytic_sr", - "udm", - "udm2", - "analytic_xml" ] } }, @@ -698,5 +649,5 @@ } } }, - "version": "2020-03-10" + "version": "02-20-20" } diff --git a/porder/porder.py b/porder/porder.py index de9ccca..b2d993a 100644 --- a/porder/porder.py +++ b/porder/porder.py @@ -32,6 +32,7 @@ import platform import datetime import pkg_resources +import dateutil.parser from bs4 import BeautifulSoup from pySmartDL import SmartDL from os.path import expanduser @@ -351,18 +352,15 @@ def idsplit_from_parser(args): # Get package version def bundles(item): - url = "https://developers.planet.com/docs/orders/product-bundles-reference/" - html = requests.get(url).text - soup = BeautifulSoup(html, "html.parser") + url = "https://developers.planet.com/theme/js/scrub_all_bundles_bundle_spec.json" + date_response = requests.get(url).json() + ref_date = dateutil.parser.parse(date_response['version']) with open(os.path.join(lpath, "bundles.json")) as f: - r = json.load(f) - current = r["version"] - curr_date = datetime.datetime.strptime(current, "%Y-%m-%d") - for detail in soup.find_all("em"): - release = detail.text.split(":")[1].strip() - ref_date = datetime.datetime.strptime(release, "%Y-%m-%d") + r=json.load(f) + current= r['version'] + curr_date = dateutil.parser.parse(current) if curr_date < ref_date: - print("Refreshing bundles to " + "\n" + str(release)) + print("Refreshing bundles to " + "\n" + str(date_response['version'])) try: url = "https://developers.planet.com/theme/js/scrub_all_bundles_bundle_spec.json" dest = os.path.join(lpath, "bundles.json") diff --git a/setup.py b/setup.py index 0b4a0c6..38687cd 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def readme(): return f.read() setuptools.setup( name='porder', - version='0.8.2', + version='0.8.3', packages=['porder'], url='https://github.com/samapriya/porder', package_data={'': ['bundles.json']},