This release is a pre-release and may not be stable for production use.
hardware-address
IEEE 802 MAC-48, EUI-48, EUI-64, and InfiniBand hardware addresses for Python.
A fast, memory-safe library for working with hardware addresses, powered by Rust.
Installation
pip install "hardware-address==1.0.0rc2"
Features
- 🚀 Fast: Native Rust implementation with Python bindings
- 🔒 Memory Safe: Written in Rust for guaranteed memory safety
- 📦 Zero Dependencies: No external dependencies
- 🔄 Multiple Formats: Parse and format addresses in colon, hyphen, or dot-separated formats
Quick Start
from hardware_address import MacAddr
# Parse from string
addr = MacAddr.parse("00:00:5e:00:53:01")
# Create from bytes
addr = MacAddr.from_bytes(b"\x00\x00\x5e\x00\x53\x01")
# String representation
print(str(addr)) # "00:00:5e:00:53:01"
print(repr(addr)) # MacAddr("00:00:5e:00:53:01")
# Get bytes
data = bytes(addr)
# Comparison and hashing
if addr1 == addr2:
print("Addresses match!")
# Use as dictionary key
devices = {addr: "Server 1"}
Supported Address Types
MacAddr (6 bytes)
IEEE 802 MAC-48/EUI-48 addresses:
from hardware_address import MacAddr
addr = MacAddr.parse("00:00:5e:00:53:01")
print(addr) # 00:00:5e:00:53:01
Eui64Addr (8 bytes)
EUI-64 addresses used in IPv6 and other protocols:
from hardware_address import Eui64Addr
addr = Eui64Addr.parse("02:00:5e:10:00:00:00:01")
print(addr) # 02:00:5e:10:00:00:00:01
InfiniBandAddr (20 bytes)
IP over InfiniBand link-layer addresses:
from hardware_address import InfiniBandAddr
addr = InfiniBandAddr.parse(
"00:00:00:00:fe:80:00:00:00:00:00:00:02:00:5e:10:00:00:00:01"
)
Parsing Formats
All address types support three parsing formats:
from hardware_address import MacAddr
# Colon-separated (standard)
addr1 = MacAddr.parse("00:00:5e:00:53:01")
# Hyphen-separated (Windows style)
addr2 = MacAddr.parse("00-00-5e-00-53-01")
# Dot-separated (Cisco style)
addr3 = MacAddr.parse("0000.5e00.5301")
# All produce the same address
assert addr1 == addr2 == addr3
API Reference
Creating Addresses
# From string
addr = MacAddr.parse("00:00:5e:00:53:01")
# From bytes
addr = MacAddr.from_bytes(b"\x00\x00\x5e\x00\x53\x01")
Converting Addresses
# To string (default format)
s = str(addr) # "00:00:5e:00:53:01"
# To bytes
data = bytes(addr) # b'\x00\x00\x5e\x00\x53\x01'
# Representation for debugging
r = repr(addr) # MacAddr("00:00:5e:00:53:01")
Comparison Operations
# Equality
if addr1 == addr2:
print("Equal")
# Ordering
if addr1 < addr2:
print("addr1 is less than addr2")
# Hashing (use as dict key)
devices = {addr: "Device 1"}
Error Handling
from hardware_address import MacAddr
try:
addr = MacAddr.parse("invalid")
except ValueError as e:
print(f"Parse error: {e}")
try:
addr = MacAddr.from_bytes(b"\x00\x00") # Wrong length
except ValueError as e:
print(f"Invalid length: {e}")
Performance
This library is implemented in Rust and compiled to native code, providing:
- Parsing: ~10-50x faster than pure Python implementations
- Memory: Zero-copy operations where possible
- Safety: No buffer overflows or memory leaks
Platform Support
Pre-built wheels are available for:
- Linux: x86_64, i686, aarch64, armv7
- macOS: x86_64 (Intel), aarch64 (Apple Silicon)
- Windows: x64, x86
- Python: CPython 3.8 through 3.14
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Links
Contributing
Contributions are welcome! See the repository for details.
Metadata
Release files for hardware-address 1.0.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hardware_address-1.0.0rc2.tar.gz | 48.9 kB | With provenance | Details |
Built distributions (wheels)
Total release size: 4.3 MB
Release files / hardware_address-1.0.0rc2.tar.gz
| Download URL | hardware_address-1.0.0rc2.tar.gz |
|---|---|
| Size | 48.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b988757c9c8af4355868f6ffa9803f421ec8b8b63707e460550cf599e6710bc8
|
|
BLAKE2b-256 checksum How to use checksums |
3b7931921c145dcf700544ae3c6b729ee17170c3d77a2d464ae76b225700847c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-win_amd64.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 150.8 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8e4d6a6e1cb06f6e066e6130e66a0b62e1d9e4fd913f2e52a3d7565e8d2a7ac4
|
|
BLAKE2b-256 checksum How to use checksums |
5a1d5bc9aae2f9fb5e42a7e76a30a4b6bfb4d69bf2f56bdd7c6e286cac0fc00f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-win32.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-win32.whl |
|---|---|
| Size | 143.5 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
1a51a8065bbb54eb76e5529c2548132f14e0e334227b433281b9a25667af9782
|
|
BLAKE2b-256 checksum How to use checksums |
806b0e92af6813c64ec3924d893ccab0ce3fc153ed2166a987dbf36ec2d325e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 459.7 kB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8b025dd0934d151806378891b8243b3a63f4b75db76d90fa03b981ed00ba7599
|
|
BLAKE2b-256 checksum How to use checksums |
aad6a765b9453962b79256a9b7eedd06dd17e8906bf6527fea4c4fc5851ba15c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 491.6 kB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
21f58024b3f6cdde8e2e36aa744e9e80912f2242e3f786c1c606ef8e728e3364
|
|
BLAKE2b-256 checksum How to use checksums |
33a5d9a51e5d3adc313771041565233a768443d53e63eb4a0db5a4ec1e1fb1bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_armv7l.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 519.0 kB |
| Tags | CPython 3.8 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
bf43ce417e1d212428582fd4d6c051eb703b760aa3977297044a93436cb3848c
|
|
BLAKE2b-256 checksum How to use checksums |
414738c856304ec5227e253caf8f033f2a939c908fa63abef6c500ed136e55ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 419.9 kB |
| Tags | CPython 3.8 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ccf3e21ef270c725edaeda81eb34bcc61871de47a888b1e917489fcd304a9ebd
|
|
BLAKE2b-256 checksum How to use checksums |
c63cd118ebf78f16fe3e8cb244a3ee08a48031a33a17401d42bc194f66e29d9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 251.3 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d58b89ba4eaca14b3861294bfc421f4fe57adb3b6ec9447457e37aeb2897dc19
|
|
BLAKE2b-256 checksum How to use checksums |
4e550e892375e15c8d71e75c1fb5b071c4c52ee2fc96db8c353c4074c163d011
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl |
|---|---|
| Size | 276.6 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ IBM System/390x abi3 |
|
SHA-256 checksum How to use checksums |
0038d35c12782d8cf1a5ad0c26920ddd1ba1148e069860c05c7154ede6b74c46
|
|
BLAKE2b-256 checksum How to use checksums |
c2b7ef29b50285a2dd8574c89ca6b5b081ce57b32805c0bb46af4c7d853e430a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl |
|---|---|
| Size | 350.8 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ PowerPC 64-le abi3 |
|
SHA-256 checksum How to use checksums |
e4f4bb8c752506958f6d28b3a3ff85116f76c305c28e355c7bfa64c8024303ce
|
|
BLAKE2b-256 checksum How to use checksums |
542cd2dc4fe40026c1b7cabc42dc07acff824f8b33b0dc2a61ea038c3d6c7719
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 242.4 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
4296b485e20c2793629f6245e70a46f211a75cd3b418b78ec04534b0352b52e1
|
|
BLAKE2b-256 checksum How to use checksums |
1f061b47b4c0dad261826c1e4582425db36cdf761c108a2a1dd4ff47e1c4fb21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 242.1 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
843ef75ed29bff58ef679f5519cac843bcb8645492ffd1267539195256f6c558
|
|
BLAKE2b-256 checksum How to use checksums |
4862efb501d78f614cb26bef6e934730a55171731339edbac98e7850f8cd66b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 269.9 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
4911a6a8d391a44423e62dbdc31128df712b8801cf24616e41ce8e84ec7cfb2a
|
|
BLAKE2b-256 checksum How to use checksums |
6e1fd22e24608b4b45ab05b11815f4aa17aa99a6f88b17bb1c8938e5033a9809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 225.9 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1f266854de1252237a84a0a4643de27b3ed56dc67bf80c9940033f197d150f1d
|
|
BLAKE2b-256 checksum How to use checksums |
970fef9f5fb98aeff2db34ff5b5a8cfc70e4ee1583ff936041a053b1286213ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logRelease files / hardware_address-1.0.0rc2-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | hardware_address-1.0.0rc2-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 227.5 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f7b8bbea1f659c14964bc27e407d7943ba1d777ffc9309c8180f9c5d3767e648
|
|
BLAKE2b-256 checksum How to use checksums |
da3353e1173758917f6958a0d22a6eb7cc1670e70267d5c041611d81e59da101
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 3, 2026.
Transparency logSecurity for hardware-address 1.0.0rc2
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.
Full provenance
All 15 files in this release have been uploaded with provenance metadata.
Attestation for hardware_address-1.0.0rc2.tar.gz
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 Oct 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.