macaddress
Like ``ipaddress``, but for hardware identifiers such as MAC addresses.
What it is and what it does
macaddress is a lightweight library for working with hardware identifiers like MAC addresses, inspired by Python's built-in ipaddress module. It provides classes for common types (EUI48/MAC, EUI64, OUI) and allows you to parse these identifiers from multiple string formats (colon-separated, dash-separated, dot-separated, or raw hex), convert them to and from bytes or integers, and perform equality and ordering comparisons. You can also define custom hardware address types by subclassing the base HWAddress class.
The library has no runtime dependencies and installs cleanly. However, it has been abandoned since its latest release on 2022-11-04 with no commits or updates since 2023-05-26, so it receives no active maintenance. It is marked as Production/Stable in its classifiers, making it suitable for stable, self-contained use cases where you do not expect ongoing support.
Use it for:
- Validate and normalize MAC addresses from user input or network device data before storing or processing.
- Convert MAC addresses between common string formats (colon, dash, dot, hex) for compatibility with different tools or protocols.
- Extract the OUI (Organizationally Unique Identifier) from a MAC address to identify the hardware manufacturer.
- Parse and compare hardware identifiers in network monitoring, device inventory, or DHCP/ARP tools.
- Define custom hardware address types (e.g., InfiniBand, CDI) for specialized networking or embedded systems work.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses, validates, and converts MAC addresses and other hardware identifiers (EUI-48, EUI-64, OUI, etc.) between string, binary, and integer forms.
Yes, if you need straightforward MAC address parsing and conversion in a stable, dependency-free package. The library is production-ready for its core use case and carries no security vulnerabilities. However, be aware that it is abandoned and will not receive updates or bug fixes; only install if you are comfortable maintaining a fork or accepting the risk of unpatched issues on newer Python versions.
Install
macaddress on PyPI
pip
pip install macaddressuv
uv add macaddresspoetry
poetry add macaddressInstalling macaddress
Before you install
Low friction install with no runtime dependencies. Last release was 1379 days ago and the repository is marked abandoned, so expect no active maintenance or bug fixes going forward.
License in practice
Licensed under 0BSD (permissive), so you can use, modify, and distribute freely with minimal restrictions.
Quickstart
pip install macaddress
import macaddress
mac = macaddress.EUI48('01-23-45-67-89-ab')
print(mac) # EUI48('01-23-45-67-89-AB')
print(bytes(mac))
print(int(mac))
Verify before relying
- Whether the abandoned status and 1379-day gap since last release poses risk for undiscovered bugs or compatibility issues with newer Python versions.
- Whether the library's feature set (EUI-48, EUI-64, OUI, CDI32, etc.) covers all hardware identifier types needed for your use case.
- Actual monthly download volume and real-world adoption patterns beyond the top-15000 tier classification.
Package facts
| License | 0BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,379 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 189,877/month — #9,920 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: macaddress-2.0.2-py3-none-any.whl
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
aioouiPerforms asynchronous lookups of…
permissive · top 15,000 on PyPI
mac-vendor-lookupResolves MAC addresses to vendor names using a…
permissive · top 15,000 on PyPI
randmacGenerates random 12-digit MAC addresses in…
permissive · top 15,000 on PyPI
graycodeConverts between two's complement integers and…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
getmacRetrieves MAC addresses of local network…
permissive · top 15,000 on PyPI
pyap2Pyap2 detects and parses postal addresses from…
permissive · top 15,000 on PyPI
pyapPyap detects and parses postal addresses from…
permissive · top 15,000 on PyPI
netifaces-plusRetrieves network interface information…
permissive · top 15,000 on PyPI
netifacesProvides portable access to network interface…
permissive · top 5,000 on PyPI