Metadata-Version: 2.4
Name: xiepengcheng
Version: 0.5.0
Summary: A growing collection of tools: an inline questionary-based network adapter picker.
Author-email: xiepengcheng <xiepengcheng2030@gmail.com>
License-Expression: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: questionary>=2.0
Dynamic: license-file

# xiepengcheng

Python 工具集合，目前包含：

- `select_network_adapter`：基于 [questionary](https://github.com/tmbo/questionary) 的内联（非全屏）网络适配器选择器（仅支持 Windows）

```bash
pip install xiepengcheng
```

## 网络适配器选择

```python
import xiepengcheng

adapter = xiepengcheng.select_network_adapter()
if adapter:
    print(adapter.name, adapter.ip_addresses, adapter.mac_address, adapter.is_up)
```

也可以跳过交互，直接拿列表自己处理：

```python
from xiepengcheng import list_network_adapters

for a in list_network_adapters():
    print(a.name, a.description, a.mac_address, a.ip_addresses, a.status)
```

`NetworkAdapter` 字段：`id`（系统级标识符，程序里应该用它而不是 `name` 来指定网卡）、`name`、`description`、`mac_address`、`ip_addresses`、`status`、`speed`，以及派生属性 `is_up`。

选择界面里，`[Up]` 显示为绿色，其他状态显示为红色。
