Admin

Administrative and organizational utilities.

Library administration utilities for siege_utilities. Provides functions for managing configuration, profiles, and system settings.

siege_utilities.admin.get_default_profile_location()[source]

Get the default profile location (project-local profiles directory).

Returns:

Path to the default profiles directory

Return type:

Path

siege_utilities.admin.set_profile_location(location, profile_type='default')[source]

Set a custom profile location for a given type.

Parameters:
  • location (Path) – Path to the profile directory

  • profile_type (str) – Type of profile location (‘default’, ‘user’, ‘client’, etc.)

Return type:

None

siege_utilities.admin.get_profile_location(profile_type='default')[source]

Get the current profile location for a given type.

Parameters:

profile_type (str) – Type of profile location (‘default’, ‘user’, ‘client’, etc.)

Returns:

Path to the profile location

Return type:

Path

siege_utilities.admin.list_profile_locations()[source]

List all configured profile locations.

Returns:

Dictionary mapping profile types to their locations

Return type:

Dict[str, Path]

siege_utilities.admin.migrate_profiles(source_location, target_location, backup=True)[source]

Migrate profiles from one location to another.

Parameters:
  • source_location (Path) – Source profile directory

  • target_location (Path) – Destination profile directory

  • backup (bool) – Whether to create a backup of target location

Returns:

Dictionary with migration statistics

Return type:

Dict[str, int]

siege_utilities.admin.create_default_profiles(profile_location=None)[source]

Create default user and client profiles in the specified location.

Parameters:

profile_location (Path | None) – Where to create profiles (defaults to default location)

Returns:

Tuple of (created_user_profile, list_of_created_client_profiles)

Return type:

Tuple[UserProfile, List[ClientProfile]]

siege_utilities.admin.validate_profile_location(location)[source]

Validate that a profile location is usable.

Parameters:

location (Path) – Path to validate

Returns:

True if location is valid, False otherwise

Return type:

bool

Submodules

Profile location management for siege_utilities. Handles default locations, custom locations, and profile migration.

siege_utilities.admin.profile_manager.create_default_profiles(profile_location=None)[source]

Create default user and client profiles in the specified location.

Parameters:

profile_location (Path | None) – Where to create profiles (defaults to default location)

Returns:

Tuple of (created_user_profile, list_of_created_client_profiles)

Return type:

Tuple[UserProfile, List[ClientProfile]]

siege_utilities.admin.profile_manager.get_default_profile_location()[source]

Get the default profile location (project-local profiles directory).

Returns:

Path to the default profiles directory

Return type:

Path

siege_utilities.admin.profile_manager.get_profile_location(profile_type='default')[source]

Get the current profile location for a given type.

Parameters:

profile_type (str) – Type of profile location (‘default’, ‘user’, ‘client’, etc.)

Returns:

Path to the profile location

Return type:

Path

siege_utilities.admin.profile_manager.get_profile_summary(profile_location=None)[source]

Get a summary of profiles in a location.

Parameters:

profile_location (Path | None) – Location to summarize (defaults to default location)

Returns:

Dictionary with profile summary statistics

Return type:

Dict[str, Any]

siege_utilities.admin.profile_manager.list_profile_locations()[source]

List all configured profile locations.

Returns:

Dictionary mapping profile types to their locations

Return type:

Dict[str, Path]

siege_utilities.admin.profile_manager.migrate_profiles(source_location, target_location, backup=True)[source]

Migrate profiles from one location to another.

Parameters:
  • source_location (Path) – Source profile directory

  • target_location (Path) – Destination profile directory

  • backup (bool) – Whether to create a backup of target location

Returns:

Dictionary with migration statistics

Return type:

Dict[str, int]

siege_utilities.admin.profile_manager.set_profile_location(location, profile_type='default')[source]

Set a custom profile location for a given type.

Parameters:
  • location (Path) – Path to the profile directory

  • profile_type (str) – Type of profile location (‘default’, ‘user’, ‘client’, etc.)

Return type:

None

siege_utilities.admin.profile_manager.validate_profile_location(location)[source]

Validate that a profile location is usable.

Parameters:

location (Path) – Path to validate

Returns:

True if location is valid, False otherwise

Return type:

bool