API Reference
This page provides an automated reference for the sus-inspector API, extracted directly from the source code.
sus_inspector.core
Core logic for the sus-inspector explorer.
Classes
InteractiveExplorer
The main 'sus' interface supporting both calls and operator overloading.
Source code in src/sus_inspector/core.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
Functions
__call__(obj, name='root')
Inspect the object via standard call: sus(obj, name='my_obj').
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
object
|
Object to inspect. |
required |
name
|
str
|
Label for the object. |
'root'
|
Returns:
| Name | Type | Description |
|---|---|---|
object |
object
|
The object untouched. |
Source code in src/sus_inspector/core.py
15 16 17 18 19 20 21 22 23 24 25 26 27 | |
__truediv__(obj)
Operator overloading: sus / obj.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
object
|
Object to inspect or Ellipsis for locals. |
required |
Returns:
| Type | Description |
|---|---|
object | None
|
object | None: The object untouched, or None if Ellipsis was used. |
Source code in src/sus_inspector/core.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
sus_inspector.cli
CLI commands for sus-inspector, including global injection.
Functions
get_injection_code()
Return the code to be injected into usercustomize.py.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Python code block. |
Source code in src/sus_inspector/cli.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
get_target_info(*, is_global_user)
Return the site-packages directory and the filename to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_global_user
|
bool
|
Whether to target global user site-packages. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Path, str]
|
tuple[Path, str]: (target_directory, filename). |
Source code in src/sus_inspector/cli.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
inject_permanently(*, is_global_user=False)
Inject sus permanently into builtins. Targets venv by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_global_user
|
bool
|
Whether to target global user site-packages. |
False
|
Source code in src/sus_inspector/cli.py
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 | |
remove_injection(*, is_global_user=False)
Remove the sus-inspector injection. Targets venv by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_global_user
|
bool
|
Whether to target global user site-packages. |
False
|
Source code in src/sus_inspector/cli.py
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 | |