Skip to main content

An implementation of `pystac`'s `StacIO` for reading static STACs stored in Azure Blob Storage.

Project description

Azure Blob Storage StacIO

PyPI version CI codecov GitHub License

An implementation of pystac's StacIO for reading static STACs stored in Azure Blob Storage. See the pystac docs for more info.

Installation

Either:

  • pip install az-blob-stacio
  • uv add az-blob-stacio

Usage

Set the global default StacIO to BlobStacIO:

import os

from az_blob_stacio import BlobStacIO

BlobStacIO.conn_str = os.environ["AZURE_STORAGE_CONNECTION_STRING"]

pystac.StacIO.set_default(BlobStacIO)

catalog = pystac.Catalog.from_file("https://myaccount.blob.core.windows.net/mycontainer/catalog.json")

Or use a context manager to temporarily set BlobStacIO as the default StacIO and reset to DefaultStacIO upon exiting the context:

import os

from az_blob_stacio import BlobStacIO, custom_stacio

BlobStacIO.conn_str = os.environ["AZURE_STORAGE_CONNECTION_STRING"]

with custom_stacio(BlobStacIO):
    catalog = pystac.Catalog.from_file("https://myaccount.blob.core.windows.net/mycontainer/catalog.json")

Overwrite behavior is configurable by setting BlobStacIO.overwrite (defaults to True).

Credentials

Azure Blob Storage credentials can be provided by setting either of the following class variables:

  • BlobStacIO.conn_str: a connection string for the Azure storage account. Checks for AZURE_STORAGE_CONNECTION_STRING in your environment by default.

  • BlobStacIO.credential: a credential that provides access to the storage account hosting the static STAC.

    from azure.core.credentials import AzureSasCredential
    
    BlobStacIO.credential = AzureSasCredential("my-sas-token")
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

az_blob_stacio-0.1.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

az_blob_stacio-0.1.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file az_blob_stacio-0.1.2.tar.gz.

File metadata

  • Download URL: az_blob_stacio-0.1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.24

File hashes

Hashes for az_blob_stacio-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ddbbf8f909551034960ee8aa7fa47abd91785bb3d67fb8fa29172c41191a36d2
MD5 cf665e4c5bd55f463e057fb1e431f76a
BLAKE2b-256 fb3b5fcdcc517e0b6c3a9a370dc0c0722743f865ccc313c6f5d03e8561cfaf08

See more details on using hashes here.

File details

Details for the file az_blob_stacio-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for az_blob_stacio-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93e09c2a6cd3c622d9c825e5cc1a818eb4c4bae8a9185dfa2e710658e12614f3
MD5 188ae978dc2d1cc9e25a01e94a7d48cf
BLAKE2b-256 c80220d5a139eb155f1e4b17c3fff975f348327685ed1775bdef34c2b56a9090

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page