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:
Return type:

None

token_provider: TokenProvider#
config: Config#
client: context_client.ContextHTTPClient#
property host: Host#

Returns the hostname from the token provider.

property token: Token#

Returns the token from the token provider.

property catalog: CatalogClient#

Returns foundry_dev_tools.clients.catalog.CatalogClient.

property compass: CompassClient#

Returns foundry_dev_tools.clients.compass.CompassClient.

property jemma: JemmaClient#

Returns foundry_dev_tools.clients.jemma.JemmaClient.

property metadata: MetadataClient#

Returns foundry_dev_tools.clients.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#

Returns foundry_dev_tools.clients.build2.Build2Client.

property foundry_stats: FoundryStatsClient#

Returns foundry_dev_tools.clients.foundry_stats.FoundryStatsClient.

property s3: S3Client#

Returns foundry_dev_tools.clients.s3_client.S3Client.

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:

Dataset

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:

Dataset

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:

Resource

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:

Resource

get_user_info()[source]#

Returns the user’s info.

Return type:

User

create_group(name, organization_rids, /, *, description=None)[source]#

Create new multipass group.

Parameters:
  • name (str) – the name the group should receive on creation

  • organization_rids (set[api_types.OrganizationRid]) – a set of organization identifiers the group will belong to

  • description (str | None) – an optional group description

Return type:

Group