foundry_dev_tools.config.context module#
Contains the FoundryContext class, a state object for API clients.
- class foundry_dev_tools.config.context.FoundryContext[source]#
Bases:
object
FoundryContext holds config and token provider for API clients.
- __init__(config=None, token_provider=None, profile=None)[source]#
- Parameters:
config (Config | None)
token_provider (TokenProvider | None)
profile (str | None)
- Return type:
None
- token_provider: TokenProvider#
- property token: Token#
Returns the token from the token provider.
- property catalog: CatalogClient#
- property compass: CompassClient#
- property jemma: JemmaClient#
- property metadata: MetadataClient#
- property data_proxy: DataProxyClient#
Returns
foundry_dev_tools.clients.data_proxy.DataProxyClient
.
- property schema_inference: SchemaInferenceClient#
Returns
foundry_dev_tools.clients.schema_inference.SchemaInferenceClient
.
- property multipass: MultipassClient#
Returns
foundry_dev_tools.clients.multipass.MultipassClient
.
- property foundry_sql_server: FoundrySqlServerClient#
Returns
foundry_dev_tools.clients.foundry_sql_server.FoundrySqlServerClient
.
- property build2: Build2Client#
- property foundry_stats: FoundryStatsClient#
Returns
foundry_dev_tools.clients.foundry_stats.FoundryStatsClient
.
- property ontologies: OntologiesClient#
Returns
foundry_dev_tools.clients.public_ontologies.OntologiesClient
.
- property cached_foundry_client: CachedFoundryClient#
Returns
foundry_dev_tools.cached_foundry_client.CachedFoundryClient
.Will be deprecated in favor of the newer v2 clients.
- property foundry_rest_client: FoundryRestClient#
Returns
foundry_dev_tools.foundry_api_client.FoundryRestClient
.Will be deprecated in favor of the newer v2 clients.
- get_dataset(rid, /, *, branch='master', create_branch_if_not_exists=True, parent_ref=None, parent_branch_id=None, **kwargs)[source]#
Returns dataset at path.
- Parameters:
rid (api_types.Rid) – the rid of the dataset
branch (api_types.Ref) – the branch of the dataset
create_branch_if_not_exists (bool) – create branch if branch does not exist
parent_ref (api_types.TransactionRid | None) – optionally the transaction off which the branch will be based (only used if branch needs to be created)
parent_branch_id (api_types.DatasetBranch | None) – optionally a parent branch name, otherwise a root branch (only used if branch needs to be created)
**kwargs – passed to
foundry_dev_tools.resources.resource.Resource.from_rid()
- Return type:
- get_dataset_by_path(path, /, *, branch='master', create_if_not_exist=False, create_branch_if_not_exists=True, parent_ref=None, parent_branch_id=None, **kwargs)[source]#
Returns dataset at path.
- Parameters:
path (api_types.FoundryPath) – the path where the dataset is located on foundry
branch (api_types.Ref) – the branch of the dataset
create_if_not_exist (bool) – if the dataset does not exist, create it
create_branch_if_not_exists (bool) – create branch if branch does not exist, branch always will be created if resource does not exist
parent_ref (api_types.TransactionRid | None) – optionally the transaction off which the branch will be based (only used if branch needs to be created)
parent_branch_id (api_types.DatasetBranch | None) – optionally a parent branch name, otherwise a root branch (only used if branch needs to be created)
**kwargs – passed to
foundry_dev_tools.resources.resource.Resource.from_path()
- Return type:
- get_resource(rid, /, *, decoration=None)[source]#
Returns resource from rid.
- Parameters:
rid (api_types.Rid) – the rid of the resource on foundry
decoration (api_types.ResourceDecorationSetAll | None) – extra decoration for this resource
**_kwargs – not used in base class
- Return type:
- get_resource_by_path(path, /, *, decoration=None)[source]#
Returns resource from path.
- Parameters:
path (api_types.FoundryPath) – the path where the resource is located on foundry
decoration (api_types.ResourceDecorationSetAll | None) – extra decoration for this resource
**_kwargs – not used in base class
- Return type: