rasterio.session module
Abstraction for sessions in various clouds.
- class rasterio.session.AWSSession(session=None, aws_unsigned=None, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None, region_name=None, profile_name=None, endpoint_url=None, requester_pays=False)
Bases:
Session
Configures access to secured resources stored in AWS S3.
- static aws_or_dummy(*args, **kwargs)
Create an AWSSession if boto3 is available, else DummySession
- static cls_from_path(path)
Find the session class suited to the data at path.
- Parameters
path (str) – A dataset path or identifier.
- Return type
class
- property credentials
The session credentials as a dict
- static from_environ(*args, **kwargs)
Create a session object suited to the environment.
- static from_foreign_session(session, cls=None)
Create a session object matching the foreign session.
- Parameters
session (obj) – A foreign session object.
cls (Session class, optional) – The class to return.
- Return type
- static from_path(path, *args, **kwargs)
Create a session object suited to the data at path.
- class rasterio.session.AzureSession(azure_storage_connection_string=None, azure_storage_account=None, azure_storage_access_key=None, azure_unsigned=False)
Bases:
Session
Configures access to secured resources stored in Microsoft Azure Blob Storage.
- static aws_or_dummy(*args, **kwargs)
Create an AWSSession if boto3 is available, else DummySession
- static cls_from_path(path)
Find the session class suited to the data at path.
- Parameters
path (str) – A dataset path or identifier.
- Return type
class
- property credentials
The session credentials as a dict
- static from_environ(*args, **kwargs)
Create a session object suited to the environment.
- static from_foreign_session(session, cls=None)
Create a session object matching the foreign session.
- Parameters
session (obj) – A foreign session object.
cls (Session class, optional) – The class to return.
- Return type
- static from_path(path, *args, **kwargs)
Create a session object suited to the data at path.
- class rasterio.session.DummySession(*args, **kwargs)
Bases:
Session
A dummy session.
- static aws_or_dummy(*args, **kwargs)
Create an AWSSession if boto3 is available, else DummySession
- static cls_from_path(path)
Find the session class suited to the data at path.
- Parameters
path (str) – A dataset path or identifier.
- Return type
class
- static from_environ(*args, **kwargs)
Create a session object suited to the environment.
- static from_foreign_session(session, cls=None)
Create a session object matching the foreign session.
- Parameters
session (obj) – A foreign session object.
cls (Session class, optional) – The class to return.
- Return type
- static from_path(path, *args, **kwargs)
Create a session object suited to the data at path.
- class rasterio.session.GSSession(google_application_credentials=None)
Bases:
Session
Configures access to secured resources stored in Google Cloud Storage
- static aws_or_dummy(*args, **kwargs)
Create an AWSSession if boto3 is available, else DummySession
- static cls_from_path(path)
Find the session class suited to the data at path.
- Parameters
path (str) – A dataset path or identifier.
- Return type
class
- property credentials
The session credentials as a dict
- static from_environ(*args, **kwargs)
Create a session object suited to the environment.
- static from_foreign_session(session, cls=None)
Create a session object matching the foreign session.
- Parameters
session (obj) – A foreign session object.
cls (Session class, optional) – The class to return.
- Return type
- static from_path(path, *args, **kwargs)
Create a session object suited to the data at path.
- class rasterio.session.OSSSession(oss_access_key_id=None, oss_secret_access_key=None, oss_endpoint=None)
Bases:
Session
Configures access to secured resources stored in Alibaba Cloud OSS.
- static aws_or_dummy(*args, **kwargs)
Create an AWSSession if boto3 is available, else DummySession
- static cls_from_path(path)
Find the session class suited to the data at path.
- Parameters
path (str) – A dataset path or identifier.
- Return type
class
- property credentials
The session credentials as a dict
- static from_environ(*args, **kwargs)
Create a session object suited to the environment.
- static from_foreign_session(session, cls=None)
Create a session object matching the foreign session.
- Parameters
session (obj) – A foreign session object.
cls (Session class, optional) – The class to return.
- Return type
- static from_path(path, *args, **kwargs)
Create a session object suited to the data at path.
- class rasterio.session.Session
Bases:
object
Base for classes that configure access to secured resources.
Notes
This class is not intended to be instantiated.
- static aws_or_dummy(*args, **kwargs)
Create an AWSSession if boto3 is available, else DummySession
- static cls_from_path(path)
Find the session class suited to the data at path.
- Parameters
path (str) – A dataset path or identifier.
- Return type
class
- static from_environ(*args, **kwargs)
Create a session object suited to the environment.
- static from_foreign_session(session, cls=None)
Create a session object matching the foreign session.
- Parameters
session (obj) – A foreign session object.
cls (Session class, optional) – The class to return.
- Return type
- static from_path(path, *args, **kwargs)
Create a session object suited to the data at path.
- class rasterio.session.SwiftSession(session=None, swift_storage_url=None, swift_auth_token=None, swift_auth_v1_url=None, swift_user=None, swift_key=None)
Bases:
Session
Configures access to secured resources stored in OpenStack Swift Object Storage.
- static aws_or_dummy(*args, **kwargs)
Create an AWSSession if boto3 is available, else DummySession
- static cls_from_path(path)
Find the session class suited to the data at path.
- Parameters
path (str) – A dataset path or identifier.
- Return type
class
- property credentials
The session credentials as a dict
- static from_environ(*args, **kwargs)
Create a session object suited to the environment.
- static from_foreign_session(session, cls=None)
Create a session object matching the foreign session.
- Parameters
session (obj) – A foreign session object.
cls (Session class, optional) – The class to return.
- Return type
- static from_path(path, *args, **kwargs)
Create a session object suited to the data at path.
- get_credential_options()
Get credentials as GDAL configuration options :rtype: dict
- rasterio.session.parse_bool(v)
CPLTestBool equivalent