You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-18Lines changed: 46 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,32 +19,31 @@ planetarycomputer configure
19
19
Alternatively, a subscription key may be provided by specifying it in the `PC_SDK_SUBSCRIPTION_KEY` environment variable. A subcription key is not required for interacting with the service, however having one in place allows for less restricted rate limiting.
20
20
21
21
22
-
## Development
23
-
24
-
The following steps may be followed in order to develop locally:
25
-
26
-
```bash
27
-
## Create and activate venv
28
-
python3 -m venv env
29
-
source env/bin/activate
22
+
## Usage
30
23
31
-
## Install requirements
32
-
python3 -m pip install -r requirements-dev.txt
24
+
This library assists with signing Azure Blob Storage URLs. The `sign` function operates directly on an HREF string, as well as several [PySTAC](https://github.com/stac-utils/pystac) objects: `Asset`, `Item`, and `ItemCollection`. In addition, the `sign` function accepts a [STAC API Client](https://pystac-client.readthedocs.io/en/stable/)`ItemSearch`, which performs a search and returns the resulting `ItemCollection` with all assets signed.
33
25
34
-
## Install locally
35
-
pip install -e .
26
+
### Automatic signing
36
27
37
-
## Format code
38
-
./scripts/format
28
+
If you're using pystac-client we recommend you use its feature to [automatically sign results](https://pystac-client.readthedocs.io/en/stable/usage.html#automatically-modifying-results) with ``planetary_computer.sign_inplace``:
Now all the results you get from that client will be signed.
44
43
45
-
##Usage
44
+
### Manual signing
46
45
47
-
This library currently assists with signing Azure Blob Storage URLs. The `sign` function operates directly on an HREF string, as well as several [PySTAC](https://github.com/stac-utils/pystac) objects: `Asset`, `Item`, and `ItemCollection`. In addition, the `sign` function accepts a [STAC API Client](https://github.com/stac-utils/pystac-client)`ItemSearch`, which performs a search and returns the resulting `ItemCollection` with all assets signed. The following example demonstrates these use cases:
46
+
Alternatively, you can manually call ``planetary_computer.sign`` on your results.
48
47
49
48
```python
50
49
from pystac import Asset, Item, ItemCollection
@@ -80,6 +79,35 @@ search = ItemSearch(
80
79
signed_item_collection = pc.sign(search)
81
80
```
82
81
82
+
### Convenience methods
83
+
84
+
You'll occasionally need to interact with the Blob Storage container directly, rather than
85
+
using STAC items. We include two convenience methods for this:
86
+
87
+
*`planetary_computer.get_container_client`: Get an [`azure.storage.blob.ContainerClient`](https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python)
88
+
*`planetary_computer.get_adlfs_fliesystem`: Get an [`adlfs.AzureBlobFilesystem`](https://github.com/fsspec/adlfs)
89
+
90
+
## Development
91
+
92
+
The following steps may be followed in order to develop locally:
0 commit comments