Skip to content

A lightweight Python tool for discovering, tracking and logging devices on your local network via nmap, with both CLI and Tkinter GUI front‑ends.

License

Notifications You must be signed in to change notification settings

IBN5100-0/simple-lan-scanner

Repository files navigation

Simple LAN Scanner

CI PyPI Python License Requires nmap Documentation

Simple LAN Scanner Logo

🔍 A powerful yet simple network scanner for discovering devices on your local network

Simple LAN Scanner GUI

✨ Features

  • 🚀 Fast Network Discovery - Leverages nmap for efficient ping sweeps
  • 💻 Dual Interface - Both CLI and GUI options available
  • 📊 Device Tracking - Persistent storage with historical data
  • 🔍 Smart Filtering - Search by MAC, IP, hostname, or manufacturer
  • 📁 Multiple Export Formats - JSON and CSV support
  • 🎯 Auto Network Detection - Intelligently finds your local network
  • 🔔 Real-time Monitoring - Continuous scanning with customizable intervals
  • 🎨 Modern GUI - Clean, intuitive interface with online/offline status

🚀 Quick Start

Installation

# From PyPI (recommended)
pip install simple-lan-scanner[cli]

# From source
git clone https://github.com/IBN5100-0/simple-lan-scanner.git
cd simple-lan-scanner
pip install -e .[cli]

Requirements

  • Python 3.10+
  • nmap installed and in PATH

Basic Usage

# Quick network scan
lan-scan scan

# Launch GUI
lan-scan gui

# Monitor network (updates every 30s)
lan-scan monitor

# Export results
lan-scan scan -o devices.json

📸 Screenshots

GUI Interface

GUI Main Window

CLI Interface

CLI Output Example

Example output:

MAC Address       | IP Address      | Hostname                  | Manufacturer               | First Seen       | Last Seen
------------------------------------------------------------------------------------------------------------------------------------------------
XX:XX:XX:XX:XX:XX | 192.168.1.1     | router.local              | Netgear Inc.               | 2025-01-15 10:30 | 2025-01-15 14:45
YY:YY:YY:YY:YY:YY | 192.168.1.100   | laptop.local              | Apple Inc.                 | 2025-01-15 10:30 | 2025-01-15 14:45
  • 🟢 Green = Online (seen < 2 minutes ago)
  • ⚪ Default = Offline

GUI Features

  • Real-time device monitoring
  • Search and filter capabilities
  • Export to JSON/CSV
  • Detailed device information
  • Context menu for quick actions

🛠️ Advanced Usage

CLI Commands

# Scan specific network
lan-scan scan --network 192.168.1.0/24

# Monitor with filters
lan-scan monitor --online-only --search "apple"

# Custom scan interval
lan-scan monitor --interval 60 --json devices.json

Python API

from simple_scanner import NetworkMonitor

# Initialize scanner
monitor = NetworkMonitor()

# Scan network
monitor.scan()

# Get devices
devices = monitor.devices()
for device in devices:
    print(f"{device.mac_address} - {device.ip_address}")

# Export results
monitor.export_json("scan_results.json")

📚 Documentation

🏗️ Project Structure

simple-lan-scanner/
├── src/simple_scanner/    # Core package
├── tests/                 # Test suite
├── docs/                  # Documentation
├── examples/              # Usage examples
└── .github/               # GitHub configuration

🧪 Development

# Setup development environment
git clone https://github.com/IBN5100-0/simple-lan-scanner.git
cd simple-lan-scanner
pip install -e .[dev]

# Run tests
pytest

# Run with coverage
pytest --cov=simple_scanner

# Format code
black src/ tests/

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Areas for Contribution

  • IPv6 support
  • Web interface
  • Additional export formats
  • Performance optimizations
  • Documentation improvements

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • nmap - The foundation of our network scanning
  • Click - CLI framework
  • Tkinter - GUI framework

🔗 Links


Made with ❤️ by IBN5100-0

About

A lightweight Python tool for discovering, tracking and logging devices on your local network via nmap, with both CLI and Tkinter GUI front‑ends.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published