Configuration

class servicex.configuration.Configuration(*, api_endpoints: List[Endpoint], default_endpoint: str | None = None, cache_path: str | None = None, shortened_downloaded_filename: bool | None = False)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field api_endpoints: List[Endpoint] [Required]
field cache_path: str | None = None
field default_endpoint: str | None = None (alias 'default-endpoint')
endpoint_dict() Dict[str, Endpoint][source]
validator expand_cache_path  »  all fields[source]

Expand the cache path to a full path, and create it if it doesn’t exist. Expand ${USER} to be the user name on the system. Works for windows, too. :param v: :return:

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'api_endpoints': FieldInfo(annotation=List[Endpoint], required=True), 'cache_path': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias_priority=2, validation_alias=AliasChoices(choices=['cache-path', 'cache_path'])), 'default_endpoint': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='default-endpoint', alias_priority=2), 'shortened_downloaded_filename': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

classmethod read(config_path: str | None = None)[source]

Read configuration from .servicex or servicex.yaml file. :param config_path: If provided, use this as the path to the .servicex file.

Otherwise, search, starting from the current working directory and look in enclosing directories

Returns:

Populated configuration object

field shortened_downloaded_filename: bool | None = False

Endpoint

class servicex.configuration.Endpoint(*, endpoint: str, name: str, token: str | None = '')[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field endpoint: str [Required]
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'endpoint': FieldInfo(annotation=str, required=True), 'name': FieldInfo(annotation=str, required=True), 'token': FieldInfo(annotation=Union[str, NoneType], required=False, default='')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

field name: str [Required]
field token: str | None = ''