Lookup the IEEE's OUI table by MAC, MAC prefix, organization name, or country
Project description
🛡️ 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64bc9a60d5274611c9709413acb093549c8e97344a95b8ec1a6783314a0b187d
|
|
| MD5 |
b8323e7c85e34102823efe53568e4a35
|
|
| BLAKE2b-256 |
5848dde0e4e05637ec2f2ba0a3da13010289f3726b16c5e441852af4e8bcdc17
|
Provenance
The following attestation bundles were made for pyoui-1.1.1.tar.gz:
Publisher:
publish.yml on nbdy/pyoui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyoui-1.1.1.tar.gz -
Subject digest:
64bc9a60d5274611c9709413acb093549c8e97344a95b8ec1a6783314a0b187d - Sigstore transparency entry: 839015727
- Sigstore integration time:
-
Permalink:
nbdy/pyoui@38d85387836d1d89b73a7af46505cb877c31673c -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38d85387836d1d89b73a7af46505cb877c31673c -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4753c0d844f0d960c750a1c62af69c4d2ba73f078871d48947d372a8462b504d
|
|
| MD5 |
0dcb4f05c65e29e7b4072017ad6a36b5
|
|
| BLAKE2b-256 |
0fd5b0a98fdf018e0c3381787dd61f744b88eff54b5d4077167f1daf10761efe
|
Provenance
The following attestation bundles were made for pyoui-1.1.1-py3-none-any.whl:
Publisher:
publish.yml on nbdy/pyoui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyoui-1.1.1-py3-none-any.whl -
Subject digest:
4753c0d844f0d960c750a1c62af69c4d2ba73f078871d48947d372a8462b504d - Sigstore transparency entry: 839015731
- Sigstore integration time:
-
Permalink:
nbdy/pyoui@38d85387836d1d89b73a7af46505cb877c31673c -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38d85387836d1d89b73a7af46505cb877c31673c -
Trigger Event:
push
-
Statement type: