-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign vrt-strings #33
Sign vrt-strings #33
Conversation
Seems like the pinned version of black didn't work with the latest Python 3.9:
I bumped those deps in c937cb1 |
Returns: | ||
str: The signed HREF or VRT | ||
""" | ||
if is_vrt_string(url): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, this doesn't seem to have a measurable effect on the timing of planetary_computer.sign(url)
:
# main, after signing a URL to get a cached token
In [5]: %timeit planetary_computer.sign(url)
12.2 µs ± 1.97 µs per loop (mean ± std. dev. of 7 runs, 100000 loops each)
# HEAD
In [4]: %timeit planetary_computer.sign(url)
11.3 µs ± 1.7 µs per loop (mean ± std. dev. of 7 runs, 100000 loops each)
FYI @lossyrob, I plan to merge this sometime today. It shouldn't have any effect on existing behavior and I think is pretty uncontroversial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
xref #32, which also includes feature requests for signing files. This handles the in-memory string portion of things.
The imagined workflow here is something like
$ gdal_translate "STACIT:\"https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=naip&bbox=-100,40,-99,41&datetime=2019-01-01T00:00:00Z%2F..\":asset=image" out.vrt
And then using it from Python like