🛡️ pyoui
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
-
Clone the repository:
git clone https://github.com/nbdy/pyoui.git cd pyoui
-
Sync dependencies:
uv sync -
Install pre-commit hooks: We use
pre-committo 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
Release files for pyoui 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyoui-1.1.1.tar.gz | 43.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyoui-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.8 kB
Release files / pyoui-1.1.1.tar.gz
| Download URL | pyoui-1.1.1.tar.gz |
|---|---|
| Size | 43.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64bc9a60d5274611c9709413acb093549c8e97344a95b8ec1a6783314a0b187d
|
|
BLAKE2b-256 checksum How to use checksums |
5848dde0e4e05637ec2f2ba0a3da13010289f3726b16c5e441852af4e8bcdc17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 20, 2026.
Transparency logRelease files / pyoui-1.1.1-py3-none-any.whl
| Download URL | pyoui-1.1.1-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4753c0d844f0d960c750a1c62af69c4d2ba73f078871d48947d372a8462b504d
|
|
BLAKE2b-256 checksum How to use checksums |
0fd5b0a98fdf018e0c3381787dd61f744b88eff54b5d4077167f1daf10761efe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 20, 2026.
Transparency log