Metadata-Version: 2.5
Name: zerofi-win
Version: 0.1.4
Summary: You own the wifi now.
Author-email: EymoDih <eymengunduz070707@gmail.com>
License-File: LICENSE.txt
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# zerofi

`zerofi` is a lightweight Python module for inspecting Wi-Fi connections on Windows. It uses the built-in `netsh` command and Python's standard library, so it has no third-party dependencies.

## Version 0.1.4

Version 0.1.4 adds a Python-friendly API that returns values you can use in your own projects, alongside the original functions that print information to the terminal.

## Features

- Check whether a Wi-Fi connection is active.
- Get the current network name, signal strength, channel, and interface details.
- Scan for nearby Wi-Fi networks and view their available radio details.
- List saved Wi-Fi profile names.
- Use returned dictionaries, lists, strings, integers, and booleans directly in your code.

## Installation

Install the package from PyPI:

```bash
pip install zerofi-win
```

Import it in Python as `zerofi`:

```python
import zerofi
```

## Quick start

### Get a connection summary

```python
import zerofi

status = zerofi.get_wifi_status()
print(status)

if status["connected"]:
    print(f"Connected to {status['ssid']}")
    print(f"Signal: {status['signal_percent']}%")
else:
    print("No Wi-Fi network is connected.")
```

`get_wifi_status()` returns a dictionary with these keys:

- `connected`: whether a Wi-Fi network is connected.
- `ssid`: connected network name, or `None` when disconnected.
- `signal_percent`: signal percentage, or `None` when unavailable.
- `channel`: connected network channel, or `None` when unavailable.
- `authentication`: authentication type, or `None` when unavailable.
- `interface`: Wi-Fi interface name, or `None` when unavailable.

### Use individual helper functions

```python
import zerofi

ssid = zerofi.get_current_ssid()
connected = zerofi.is_connected()
signal = zerofi.get_signal_strength()

print(ssid)
print(connected)
print(signal)
```

- `get_current_ssid()` returns the connected network name, or `None`.
- `is_connected()` returns `True` or `False`.
- `get_signal_strength()` returns an integer from 0 to 100, or `None`.

### Scan nearby networks

```python
import zerofi

networks = zerofi.get_nearby_networks()
for network in networks:
    print(network)
```

Each network is returned as a dictionary. Depending on the information reported by Windows, it can include `ssid`, `authentication`, `encryption`, `signal`, and `channel`.

### List saved profile names

```python
import zerofi

profile_names = zerofi.get_saved_networks()
print(profile_names)
```

This returns profile names only; it does not return saved passwords.

## Legacy print functions

The original terminal-output functions are still available:

```python
import zerofi

zerofi.ssidprint()
zerofi.signalstrenght()  # Original function name spelling is retained.
zerofi.adapterinfo()
zerofi.listprofiles()
```

The newer `get_...` functions are generally more convenient for applications because they return data instead of printing it.

## Requirements and limitations

- **Operating system:** Windows.
- **System command:** `netsh` (included with Windows).
- **Dependencies:** None beyond Python's standard library.
- Some returned fields depend on the Wi-Fi adapter, current connection, and information reported by Windows. Scanning requires a working wireless adapter.

## License

See the repository's license file for license terms.
