Skip to main content

hardware-address

IEEE 802 MAC-48, EUI-48, EUI-64, and InfiniBand hardware addresses for Python.

PyPI version License Python versions

A fast, memory-safe library for working with hardware addresses, powered by Rust.

Installation

pip install "hardware-address==1.0.0"

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:

at your option.

Contributing

Contributions are welcome! See the repository for details.

Metadata

Release files for hardware-address 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hardware-address 1.0.0
File Size Uploaded Provenance
hardware_address-1.0.0.tar.gz 49.0 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for hardware-address 1.0.0
File
hardware_address-1.0.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
hardware_address-1.0.0-cp38-abi3-win32.whl CPython 3.8 abi3 Windows x86-32 Details
hardware_address-1.0.0-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details
hardware_address-1.0.0-cp38-abi3-musllinux_1_2_i686.whl CPython 3.8 abi3 Linux musl 1.2+ x86-32 Details
hardware_address-1.0.0-cp38-abi3-musllinux_1_2_armv7l.whl CPython 3.8 abi3 Linux musl 1.2+ ARMv7l Details
hardware_address-1.0.0-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details
hardware_address-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
hardware_address-1.0.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.8 abi3 Linux glibc 2.17+ IBM System/390x Details
hardware_address-1.0.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.8 abi3 Linux glibc 2.17+ PowerPC 64-le Details
hardware_address-1.0.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.8 abi3 Linux glibc 2.17+ ARMv7l Details
hardware_address-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
hardware_address-1.0.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl CPython 3.8 abi3 Linux glibc 2.5+ x86-32 Details
hardware_address-1.0.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
hardware_address-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details

Total release size: 4.3 MB

Release files / hardware_address-1.0.0.tar.gz

Download URL hardware_address-1.0.0.tar.gz
Size 49.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2e54eb7aef3d6d671dc5969cfdacfeb38e1cf70db8d0637ff3fb1cbf7f5d1854
BLAKE2b-256 checksum
How to use checksums
ba380d86fe12694bb057e4fb1f0d26035014f12b5bce2fcefc0bcc7dc831c24a
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 log

Release files / hardware_address-1.0.0-cp38-abi3-win_amd64.whl

Download URL hardware_address-1.0.0-cp38-abi3-win_amd64.whl
Size 150.9 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
659911c3ce0fc97ceeb4d3292a5819da533f778982b59907f4ed0af5e62a1883
BLAKE2b-256 checksum
How to use checksums
6f67cb90c618d44c6536b4ecee9a5f89144f901622bec3c403bb7ff09a74b084
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 log

Release files / hardware_address-1.0.0-cp38-abi3-win32.whl

Download URL hardware_address-1.0.0-cp38-abi3-win32.whl
Size 143.5 kB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
672e2712a34f7fb4761f60441c4873faa6fb860e5cd3d4b44e6152a1fe5f7db0
BLAKE2b-256 checksum
How to use checksums
b11901ff611eaf73e6abe49c62357b46874567c12cf3c7680023986bd00c5ef7
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 log

Release files / hardware_address-1.0.0-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL hardware_address-1.0.0-cp38-abi3-musllinux_1_2_x86_64.whl
Size 459.5 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
28314aa69e9d3ca588d96c9daa5207603cda6745ef40e664e404fab6cd9f4c5d
BLAKE2b-256 checksum
How to use checksums
2b3de76e2546ed15ca2c876ac0767ca00ad9dafde378f25e1e3766987f05a455
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 log

Release files / hardware_address-1.0.0-cp38-abi3-musllinux_1_2_i686.whl

Download URL hardware_address-1.0.0-cp38-abi3-musllinux_1_2_i686.whl
Size 491.5 kB
Tags CPython 3.8 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
6e4d7cec82c12031ccd2c757f4c5c0b2aca674bc931cc52a3aca44e83bc074e4
BLAKE2b-256 checksum
How to use checksums
8537bd68ef341c3e208b453cc79405a3ed9685777143bd15619814f5f9356c8a
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 log

Release files / hardware_address-1.0.0-cp38-abi3-musllinux_1_2_armv7l.whl

Download URL hardware_address-1.0.0-cp38-abi3-musllinux_1_2_armv7l.whl
Size 518.9 kB
Tags CPython 3.8 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
6777a6d5f8a5095334970b0bb528f7f4d321b1a95627faa6072ab091c951c113
BLAKE2b-256 checksum
How to use checksums
1e38035d1315de47c78d9c6b42bd12cb8604a0561a78e7f107f5934c175d779a
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 log

Release files / hardware_address-1.0.0-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL hardware_address-1.0.0-cp38-abi3-musllinux_1_2_aarch64.whl
Size 420.0 kB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
195c7f7b94320f0cc27f1e6d17a19334a177a95ce9e301d0479af28783110002
BLAKE2b-256 checksum
How to use checksums
939e50ef8a9fec24d919aea6233074bbd05b64214b316fcc442346ca8303ac36
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 log

Release files / hardware_address-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hardware_address-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 251.5 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5916691f0a7c9087a9cdb0dac28371c8ca8e5f92a1856632d7500d174f8ee0a4
BLAKE2b-256 checksum
How to use checksums
2d0df505d85650ef0f4d20307f455e845a6aef1855825be87fe414f1be948ba7
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 log

Release files / hardware_address-1.0.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL hardware_address-1.0.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 276.3 kB
Tags CPython 3.8 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
5e2cb00c28540a875563ec955c282e5e183c19b93bb78ecbe8ebf2c2f3e20e82
BLAKE2b-256 checksum
How to use checksums
5178bbf7e339973d63bc43b4e9f93c9facf731295c3f5ac97ebf404d7057466f
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 log

Release files / hardware_address-1.0.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL hardware_address-1.0.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 350.5 kB
Tags CPython 3.8 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
265ebfe379a5b6b5a7f53ff4b4ababc1f9d5a84b933df59ae773b01e62dff3c0
BLAKE2b-256 checksum
How to use checksums
76210ff7af9b6a0ed6cb666056bbfee7d3d2aeb2f6abb799f23633bad38e38ec
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 log

Release files / hardware_address-1.0.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL hardware_address-1.0.0-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
d4621a164ffd5d88bd6e4391b0e229239b193178098887ac6dea0b7f4539b2f7
BLAKE2b-256 checksum
How to use checksums
ba32c2abaf8fb33a47ffec1385beb0dd95d8260b950ad949c29356bdaadbb766
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 log

Release files / hardware_address-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hardware_address-1.0.0-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
4bf5d7f4baa4e302a3b835ed616e9b5eb3d0e0964e635ce19f39e5a1e188f8aa
BLAKE2b-256 checksum
How to use checksums
0d8f99e6fa98002949ed537ec4d01b3b276dac5db6f25d815e3716f5b41aa469
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 log

Release files / hardware_address-1.0.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl

Download URL hardware_address-1.0.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Size 270.7 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-32 abi3
SHA-256 checksum
How to use checksums
e0a11ba09c28cf5297a4775afa5baaffc50759efa3d813badf8c7fe60a2cad85
BLAKE2b-256 checksum
How to use checksums
01aa2b40390aa747e5c381b4f8ca19d70bb973d7a885b26afc849cf7bb3d0cc5
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 log

Release files / hardware_address-1.0.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL hardware_address-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
Size 226.0 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cd0c819815e3ce3f90cfd0d2d6bba02593cc762c3c4749c39a56f651fd0a67d2
BLAKE2b-256 checksum
How to use checksums
722cc77e435bd156e4838367fd07e153a29171ac04f8f44d1514ece591a056c3
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 log

Release files / hardware_address-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL hardware_address-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 227.4 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ebaaeccee402689596cf561e356aecf7ca38f6ed04534440a73d4deb696c05c9
BLAKE2b-256 checksum
How to use checksums
cd7c374cb66279284822de31d4f41433072933fae83502864877db6eb2571469
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 log

Security for hardware-address 1.0.0

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.

Select from 15 files

Attestation for hardware_address-1.0.0.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page