Skip to main content

Lookup the IEEE's OUI table by MAC, MAC prefix, organization name, or country

Project description

🛡️ pyoui

CodeFactor

pyoui is a lightweight Python utility to lookup and parse the IEEE OUI (Organizationally Unique Identifier) database. Easily identify network device vendors by their MAC addresses or search through the IEEE registry.

✨ Features

  • 🔍 Flexible Search: Lookup by MAC address, prefix, organization name, or country.
  • 🚀 CLI & Library: Use it as a standalone tool or a Python package.
  • 📅 Auto-Managed Data: Automatically downloads and caches the latest IEEE OUI data.
  • 🛠️ Modern Tooling: Built with uv, ruff, and type hints.

🚀 Installation

For Users

pip install pyoui

For Developers (using uv)

uv add pyoui

From Source

pip install git+https://github.com/nbdy/pyoui

📖 Usage

Command Line Interface

Quickly search the OUI database from your terminal:

# Search by MAC prefix
pyoui --prefix 00:22:72

# Search by organization name
pyoui --organization "national security"

# Search by country code (ISO 3166-1 alpha-2)
pyoui --country-code US

Run pyoui --help to see all available flags and options (like output formats: JSON, CSV, Table).

Python API

Integrate pyoui into your own scripts:

from pyoui import OUI

# Initialize and parse the OUI data
# It will download the database if it doesn't exist or is older than 30 days
entries = OUI().parse()

# Lookup by MAC address
entry = next(entries.by_mac("BC:23:92:42:42:42"))
print(f"Vendor: {entry.organization.name}")

# Search by organization name
for entry in entries.by_organization("national security"):
    print(f"{entry.prefix} -> {entry.organization.name}")

# Filter by country
us_entries = list(entries.by_country_code("US"))
print(f"Found {len(us_entries)} US-based organizations.")

🧑‍💻 Development

This project uses uv for dependency management.

Setup

  1. Clone the repository:

    git clone https://github.com/nbdy/pyoui.git
    cd pyoui
    
  2. Sync dependencies:

    uv sync
    
  3. Install pre-commit hooks: We use pre-commit to ensure code quality.

    uv run pre-commit install
    

Common Tasks

  • Run Tests: uv run pytest
  • Lint Code: uv run ruff check .
  • Build Package: uv build
  • Run CLI locally: uv run pyoui --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyoui-1.1.1.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyoui-1.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file pyoui-1.1.1.tar.gz.

File metadata

  • Download URL: pyoui-1.1.1.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyoui-1.1.1.tar.gz
Algorithm Hash digest
SHA256 64bc9a60d5274611c9709413acb093549c8e97344a95b8ec1a6783314a0b187d
MD5 b8323e7c85e34102823efe53568e4a35
BLAKE2b-256 5848dde0e4e05637ec2f2ba0a3da13010289f3726b16c5e441852af4e8bcdc17

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyoui-1.1.1.tar.gz:

Publisher: publish.yml on nbdy/pyoui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyoui-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyoui-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyoui-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4753c0d844f0d960c750a1c62af69c4d2ba73f078871d48947d372a8462b504d
MD5 0dcb4f05c65e29e7b4072017ad6a36b5
BLAKE2b-256 0fd5b0a98fdf018e0c3381787dd61f744b88eff54b5d4077167f1daf10761efe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyoui-1.1.1-py3-none-any.whl:

Publisher: publish.yml on nbdy/pyoui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page