PathVariable API Reference¶
API documentation¶
            hands_scaphoid.objects.PathVariable
¶
    PathVariable module for hands-scaphoid package.
This module provides the PathVariable class with comprehensive path validation. ---yaml File: name: PathVariable.py uuid: 1ab01ca2-84c3-454a-9589-5ba028a0c2ce date: 2025-10-03
Description
Path variable class with ValidationMixin integration for robust path validation
Project
name: hands_scaphoid uuid: 2945ba3b-2d66-4dff-b898-672c386f03f4 url: https://github.com/42sol-eu/hands_scaphoid
Authors: ["Andreas Felix Häberle felix@42sol.eu"]
Abbreviations: - OS[system]: Operating System
Classes¶
            PathVariable
¶
    
              Bases: ValidationMixin, VariableItem
A variable that contains a path with comprehensive validation.
Combines VariableItem functionality with ValidationMixin to provide: - Path-specific validation rules - Cross-platform path compatibility checking - Strict mode for enhanced validation - Built-in rules for common path issues
Source code in src/hands_scaphoid/objects/PathVariable.py
                41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255  |  | 
Attributes¶
            value
  
      property
      writable
  
¶
    Get the path value.
            valid
  
      property
  
¶
    Check if the path passes validation rules.
            not_valid
  
      property
  
¶
    Check if the path does not pass validation rules.
            invalid
  
      property
  
¶
    Check if the path does not pass validation rules.
            exists
  
      property
  
¶
    Check if the path exists on the filesystem.
            not_exists
  
      property
  
¶
    Check if the path does not exist on the filesystem.
            last_violations
  
      property
  
¶
    Get violations from the last validation run.
Functions¶
            get_validation_summary()
¶
    Get a summary of the current validation status.
Returns:
| Name | Type | Description | 
|---|---|---|
dict |             
                  dict
             | 
            
               Summary containing validity, violations, and recommendations  | 
          
Source code in src/hands_scaphoid/objects/PathVariable.py
              
            __repr__()
¶
    Returns a string representation of the PathVariable.
Source code in src/hands_scaphoid/objects/PathVariable.py
              
            is_valid_path(path, strict_mode=False, cross_platform=False)
  
      classmethod
  
¶
    Check if a given path string is valid according to validation rules.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                path
             | 
            
                  str
             | 
            
               Path string to validate  | 
            required | 
                strict_mode
             | 
            
                  bool
             | 
            
               Enable strict validation  | 
            
                  False
             | 
          
                cross_platform
             | 
            
                  bool
             | 
            
               Enable cross-platform validation  | 
            
                  False
             | 
          
Returns:
| Name | Type | Description | 
|---|---|---|
bool |             
                  bool
             | 
            
               True if path is valid, False otherwise  | 
          
Source code in src/hands_scaphoid/objects/PathVariable.py
              
            does_exist(path)
  
      classmethod
  
¶
    
            get_path_violations(path, strict_mode=False, cross_platform=False)
  
      classmethod
  
¶
    Get validation violations for a path without creating a persistent object.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                path
             | 
            
                  str
             | 
            
               Path string to validate  | 
            required | 
                strict_mode
             | 
            
                  bool
             | 
            
               Enable strict validation  | 
            
                  False
             | 
          
                cross_platform
             | 
            
                  bool
             | 
            
               Enable cross-platform validation  | 
            
                  False
             | 
          
Returns:
| Type | Description | 
|---|---|
                  List[ValidationViolation]
             | 
            
               List[ValidationViolation]: List of violations found  | 
          
Source code in src/hands_scaphoid/objects/PathVariable.py
              
            to_dict()
¶
    Serialize the PathVariable to a dictionary.
Returns:
| Name | Type | Description | 
|---|---|---|
dict |             
                  dict
             | 
            
               Dictionary representation including validation config  | 
          
Source code in src/hands_scaphoid/objects/PathVariable.py
              
            from_dict(data)
  
      classmethod
  
¶
    Create PathVariable from dictionary representation.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                data
             | 
            
                  dict
             | 
            
               Dictionary containing PathVariable data  | 
            required | 
Returns:
| Name | Type | Description | 
|---|---|---|
PathVariable |             
                  PathVariable
             | 
            
               Configured instance  |