Registry / http-networking / pyric
library0.1.6.3pypypi✓ verified 87d ago

Pyric is a Python library designed to simplify interaction with wireless network interfaces on Linux. It provides tools to manage wireless devices, query their status, and control modes like monitor mode. The current version is 0.1.6.3, and it appears to be actively maintained with recent commits, though new releases are infrequent.

pip install pyric
INSTALL
IMPORT
SIG · PYRIC
P
pyric
http-networkingpythonv0.1.6.3
Install
2.5s avg
Import
107ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.112s · 20.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.5s · import 0.102s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pyw
from pyric import pyw
The 'pyw' module contains the primary API for wireless interface management functions.
wireless
from pyric import wireless
The 'wireless' module contains core data structures and helper functions, often used implicitly or alongside 'pyw'.

This quickstart demonstrates how to import `pyw` and list available wireless interfaces on your system, including a crucial check for root privileges which are often required for Pyric operations. It also shows how to get basic information like driver and PHY number for detected interfaces.

import os from pyric import pyw # Check for root privileges - Pyric often requires root to interact with wireless interfaces if os.geteuid() != 0: print("Warning: This script should ideally be run as root for full functionality.\nProceeding, but some operations might fail due to permissions.") # List all wireless interfaces try: interfaces = pyw.winterfaces() if interfaces: print(f"Found wireless interfaces: {', '.join(interfaces)}") for iface in interfaces: print(f" - Interface: {iface}, Driver: {pyw.driverinfo(iface)}, PHY: {pyw.phynum(iface)}") else: print("No wireless interfaces found. Ensure adapter is enabled and drivers are loaded.") except Exception as e: print(f"An error occurred while listing interfaces: {e}") print("Ensure you have proper permissions (run as root) and that wireless drivers are loaded.")
Debug
Known issues
breakingPyric is primarily designed for Linux environments. Most functionality related to wireless interface control (e.g., monitor mode, changing MAC addresses) will not work on Windows or macOS.
fix
Ensure you are running Pyric on a Linux operating system for full functionality. Use platform-specific libraries or conditional logic if cross-platform support is needed.
affects: All versions
gotchaMany Pyric operations, especially those involving changing interface modes or properties, require root (sudo) privileges. Running without root will result in `PermissionError` or operations silently failing.
fix
Execute your Python script with `sudo python your_script.py`. Incorporate `os.geteuid() != 0` checks in your code to alert users if root is required.
affects: All versions
gotchaWireless interface names can vary (e.g., `wlan0`, `wlp3s0`, `phy0`, `mon0`). Hardcoding interface names can lead to 'interface not found' errors. Also, interfaces created in monitor mode (e.g., `mon0`) might need to be explicitly removed.
fix
Dynamically discover interfaces using `pyw.winterfaces()` or `pyw.phynum()` and select the desired one. Always clean up temporary interfaces created (e.g., `pyw.monstop('mon0')`).
affects: All versions
gotchaEncountering 'No such device' or similar errors when trying to put an interface into monitor mode. This can happen if the device doesn't support monitor mode, the driver is faulty, or another process is using the interface.
fix
Verify the capabilities of your wireless card and its driver using `iw list`. Ensure no other network managers (like NetworkManager) are interfering. Try bringing the interface down (`pyw.down(dev)`) before changing its mode (`pyw.monstart(dev, 'mon0')`).
affects: All versions
Errors
Common errors & fixes
PermissionError: [Errno 1] Operation not permitted
Pyric attempted to perform a privileged operation (e.g., changing interface mode, listing all devices) without root access.
fix
Run your Python script with `sudo`. Example: `sudo python your_script.py`.
IndexError: list index out of range
You are trying to access an element from the list of wireless interfaces (e.g., `devs[0]`) but the list is empty, meaning no wireless interfaces were detected by Pyric.
fix
Check `pyw.winterfaces()` for an empty list before attempting to access elements. Ensure your wireless adapter is present, enabled, and its drivers are loaded. Also, verify you're running on Linux.
pyric.exceptions.WirelessException: Wireless device does not exist (or similar message indicating device problems)
The specified wireless interface name does not exist on the system, or it's not a recognized wireless device, or it's down/unresponsive.
fix
Verify the interface name using `ifconfig` or `ip a`. Use `pyw.winterfaces()` to get a list of active wireless interfaces. Ensure the interface is 'up' if required by the operation.
Upgrade
Version history
0.1.6.3latest on PyPI · released Dec 4, 2016
Audit
Dependencies
scapyrequiredUsed for low-level packet manipulation and wireless operations.
Agent activity
6 hits · last 30 days
node
6
Resources
pyric — pip install pyric · libregistry