system_info
sleap.system_info
¶
System information and startup banner for SLEAP.
Classes:
| Name | Description |
|---|---|
BinaryInfo |
Information about a CLI binary. |
CondaInfo |
Information about conda environment. |
GPUInfo |
Information about GPU. |
PackageInfoData |
Information about an installed Python package. |
UVInfo |
Information about uv installation and configuration. |
Functions:
| Name | Description |
|---|---|
analyze_path |
Analyze PATH for conflicts. |
get_all_package_info |
Get info for all relevant SLEAP packages. |
get_binary_info |
Get detailed information about a CLI binary. |
get_conda_info_data |
Get conda environment information. |
get_default_python_version |
Get the default Python version from .python-version files or UV_PYTHON. |
get_detailed_package_info |
Get detailed package info including git status for editables. |
get_disk_info |
Get disk usage info for path: (used, available, total). |
get_ffmpeg_info |
Get ffmpeg binary information from PATH and imageio-ffmpeg. |
get_git_info |
Get git information for a directory. |
get_memory_info |
Get RAM usage info: (used, available, total). Cross-platform. |
get_nvidia_info |
Get NVIDIA driver version, CUDA version, and GPU info. |
get_package_info |
Get package version, location, and install source without importing. |
get_pytorch_info |
Get PyTorch version and device information. |
get_pytorch_info_detailed |
Get PyTorch version, accelerator, and CUDA version. |
get_uv_config_value |
Get a uv config value by checking config files and env vars. |
get_uv_info_data |
Get comprehensive uv information including config settings. |
print_startup_banner |
Print the SLEAP startup banner with version info. |
run_command |
Run a command and return (returncode, stdout, stderr). |
BinaryInfo
dataclass
¶
CondaInfo
dataclass
¶
Information about conda environment.
Source code in sleap/system_info.py
GPUInfo
dataclass
¶
PackageInfoData
dataclass
¶
Information about an installed Python package.
Source code in sleap/system_info.py
UVInfo
dataclass
¶
Information about uv installation and configuration.
Source code in sleap/system_info.py
analyze_path()
¶
Analyze PATH for conflicts.
Source code in sleap/system_info.py
get_all_package_info()
¶
Get info for all relevant SLEAP packages.
Returns:
| Type | Description |
|---|---|
Dict
|
Dict mapping package names to their info dicts. Only includes packages that are installed. |
Source code in sleap/system_info.py
get_binary_info(name)
¶
Get detailed information about a CLI binary.
Source code in sleap/system_info.py
get_conda_info_data()
¶
Get conda environment information.
Source code in sleap/system_info.py
get_default_python_version()
¶
Get the default Python version from .python-version files or UV_PYTHON.
Source code in sleap/system_info.py
get_detailed_package_info(name)
¶
Get detailed package info including git status for editables.
Source code in sleap/system_info.py
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | |
get_disk_info(path)
¶
Get disk usage info for path: (used, available, total).
Source code in sleap/system_info.py
get_ffmpeg_info()
¶
Get ffmpeg binary information from PATH and imageio-ffmpeg.
Source code in sleap/system_info.py
1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 | |
get_git_info(path)
¶
Get git information for a directory.
Source code in sleap/system_info.py
get_memory_info()
¶
Get RAM usage info: (used, available, total). Cross-platform.
Source code in sleap/system_info.py
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 | |
get_nvidia_info()
¶
Get NVIDIA driver version, CUDA version, and GPU info.
Source code in sleap/system_info.py
get_package_info(name)
¶
Get package version, location, and install source without importing.
Uses importlib.metadata so we don't have to import heavy packages just to check their versions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Package name (e.g., "sleap", "sleap-io", "numpy") |
required |
Returns:
| Type | Description |
|---|---|
Dict
|
Dict with version, location, source, and editable fields. If package is not installed, version will be None. |
Source code in sleap/system_info.py
get_pytorch_info()
¶
Get PyTorch version and device information.
Avoids importing torch at module level for fast startup.
Returns:
| Type | Description |
|---|---|
Dict
|
Dict with: - installed: bool - whether PyTorch is installed - version: str or None - PyTorch version - accelerator: str - "cuda", "mps", or "cpu" - cuda_version: str or None - CUDA version if available - driver_version: str or None - NVIDIA driver version if available - device_name: str or None - GPU name if available |
Source code in sleap/system_info.py
get_pytorch_info_detailed()
¶
Get PyTorch version, accelerator, and CUDA version.
Source code in sleap/system_info.py
get_uv_config_value(key)
¶
Get a uv config value by checking config files and env vars.
Source code in sleap/system_info.py
get_uv_info_data()
¶
Get comprehensive uv information including config settings.
Source code in sleap/system_info.py
print_startup_banner(verbose=False, console=None)
¶
Print the SLEAP startup banner with version info.
Displays a colorful ASCII art banner with SLEAP branding, version information, and helpful links for documentation and support.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
bool
|
If True, show detailed package table with versions and locations. |
False
|
console
|
Optional[Console]
|
Optional Rich Console instance. If None, creates a new one. |
None
|
Source code in sleap/system_info.py
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | |
run_command(cmd, timeout=5)
¶
Run a command and return (returncode, stdout, stderr).