Lookup the IEEE's OUI table by MAC, MAC prefix, organization name, or country
Project description
pyoui
Installation
- Pip (users):
pip install pyoui
- uv (inside your project):
uv add pyoui
- Install from the main branch:
pip install git+https://github.com/nbdy/pyoui
CLI usage
Run:
pyoui --help
Options:
- -o, --outfile: file path for the downloaded IEEE OUI text file
- -d, --debug: enable debug logging
- -p, --prefix: search by MAC prefix (e.g., 00:22:72)
- -org, --organization: search by organization name
- -cc, --country-code: search by 2-letter country code (e.g., US)
- -cn, --country-name: search by country name (e.g., United States)
Examples:
pyoui -p 00:22:72
pyoui -org "national security"
pyoui -cc US
... use by code:
from pyoui import OUI
entries = OUI(debug=True).parse()
print("entries:", entries.size())
e = next(entries.by_organization("national security"))
print("organization", e.organization.__dict__, e.prefix)
e = next(entries.by_prefix("00:22:72"))
print("prefix", e.organization.__dict__, e.prefix)
e = next(entries.by_mac("BC:23:92:42:42:42"))
print("mac", e.organization.__dict__, e.prefix)
e = list(entries.by_country_code("US"))
print("length:", len(e))
print("first item:", e[0].prefix, e[0].organization.__dict__)
ae = list(entries.by_country_name("United States"))
print("by country code length:", len(e), " | by name length:", len(ae))
print("lengths should be equal")
Development
This project uses uv for dependency management and builds.
- Create and sync a virtual environment:
uv venv uv sync
- Run tests:
uv run pytest
- Build the package (sdist and wheel):
uv build - Run the CLI without installing:
uv run pyoui --help
Publishing
Releases are published automatically to PyPI via GitHub Actions using PyPI Trusted Publishing.
- Create a GitHub release (or trigger the workflow manually). Upon a published release, the workflow will:
- Build the package with
uv build. - Upload the artifacts to PyPI using
pypa/gh-action-pypi-publishwith OpenID Connect (OIDC).
- Build the package with
To enable trusted publishing, ensure the PyPI project is configured to trust this GitHub repository. See: https://github.com/pypa/gh-action-pypi-publish
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.0.0.tar.gz.
File metadata
- Download URL: pyoui-1.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7618b702af910f9f9e1e3636e4c5cd8087e0abcddaa2cb5a7bb84feda2996f6
|
|
| MD5 |
fbe2809f4b290ce09edbdee4ff56b9f9
|
|
| BLAKE2b-256 |
ee3905a3949891a8521de74d2f65ce14db6da8d86cf7edc1529ec14fe289e55d
|
Provenance
The following attestation bundles were made for pyoui-1.0.0.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.0.0.tar.gz -
Subject digest:
d7618b702af910f9f9e1e3636e4c5cd8087e0abcddaa2cb5a7bb84feda2996f6 - Sigstore transparency entry: 630352713
- Sigstore integration time:
-
Permalink:
nbdy/pyoui@77dc330bb8da30a48b84c32f30c7b14f21ed8789 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@77dc330bb8da30a48b84c32f30c7b14f21ed8789 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyoui-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyoui-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.2 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 |
d29b9dfa8434ad917d8979c3865c84cb9db090db71d7605abbc3ba7ce1e0eaee
|
|
| MD5 |
6eba247caf4e7bbdd69966af81b817df
|
|
| BLAKE2b-256 |
1bb97bcb531d776865744ca909befdd752fc7c01a508146cdf8bcd46596d2897
|
Provenance
The following attestation bundles were made for pyoui-1.0.0-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.0.0-py3-none-any.whl -
Subject digest:
d29b9dfa8434ad917d8979c3865c84cb9db090db71d7605abbc3ba7ce1e0eaee - Sigstore transparency entry: 630352718
- Sigstore integration time:
-
Permalink:
nbdy/pyoui@77dc330bb8da30a48b84c32f30c7b14f21ed8789 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@77dc330bb8da30a48b84c32f30c7b14f21ed8789 -
Trigger Event:
push
-
Statement type: