Skip to main content
Pre-release

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.

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.0rc1"

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.0rc1

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.0rc1
File Size Uploaded Provenance
hardware_address-1.0.0rc1.tar.gz 11.4 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for hardware-address 1.0.0rc1
File
hardware_address-1.0.0rc1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
hardware_address-1.0.0rc1-cp38-abi3-win32.whl CPython 3.8 abi3 Windows x86-32 Details
hardware_address-1.0.0rc1-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details
hardware_address-1.0.0rc1-cp38-abi3-musllinux_1_2_i686.whl CPython 3.8 abi3 Linux musl 1.2+ x86-32 Details
hardware_address-1.0.0rc1-cp38-abi3-musllinux_1_2_armv7l.whl CPython 3.8 abi3 Linux musl 1.2+ ARMv7l Details
hardware_address-1.0.0rc1-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details
hardware_address-1.0.0rc1-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.0rc1-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.0rc1-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.0rc1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.8 abi3 Linux glibc 2.17+ ARMv7l Details
hardware_address-1.0.0rc1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
hardware_address-1.0.0rc1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl CPython 3.8 abi3 Linux glibc 2.5+ x86-32 Details
hardware_address-1.0.0rc1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
hardware_address-1.0.0rc1-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.0rc1.tar.gz

Download URL hardware_address-1.0.0rc1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2b86adeee78fbf69814bf3e409b4061506d03eadcd3c3d5470c911f530411cbf
BLAKE2b-256 checksum
How to use checksums
c621bac2392d57b8a452f73066390def1d26bea975f7f6aa2f8d35b78ea571a7
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.0rc1-cp38-abi3-win_amd64.whl

Download URL hardware_address-1.0.0rc1-cp38-abi3-win_amd64.whl
Size 151.0 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cdb2a919e0cc0f058a3d385850715e6b60328adfa1ffc41c61236a4480c491e0
BLAKE2b-256 checksum
How to use checksums
7207d4b68dcb7a7b58c175f5ef9b55a9620745052c678485c8e6bb0780b85e69
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.0rc1-cp38-abi3-win32.whl

Download URL hardware_address-1.0.0rc1-cp38-abi3-win32.whl
Size 143.4 kB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
9e9519ffb6ddc995fe8fcdf2e6cb3304ff1f9eb85ddeb64eb35af068233fd679
BLAKE2b-256 checksum
How to use checksums
b35a6143bfebd3d1f04455b86765eceb98d61d5c2d68dbc1eaaf6bf44b6c1c42
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.0rc1-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL hardware_address-1.0.0rc1-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
9b80cfcea0cec7db2fc56528739281b01d4184419f9f4957da823043749d6f58
BLAKE2b-256 checksum
How to use checksums
881ff21d158456154895c4017cc7a84345f701b99f77c6d6f266f3db570f8f28
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.0rc1-cp38-abi3-musllinux_1_2_i686.whl

Download URL hardware_address-1.0.0rc1-cp38-abi3-musllinux_1_2_i686.whl
Size 491.9 kB
Tags CPython 3.8 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
02a7e40a89431a08032d8d3774f9d9f19146a1024896084f4f087f62eb60f7ec
BLAKE2b-256 checksum
How to use checksums
524e9f262caf48eacc656da16077745f3f26cb8cfd8e982e08a18c6870f31f4c
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.0rc1-cp38-abi3-musllinux_1_2_armv7l.whl

Download URL hardware_address-1.0.0rc1-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
14937c18f748072fb581edfade8010fad6c5feb106e7c587067176754206745a
BLAKE2b-256 checksum
How to use checksums
0341bef32633e52a7f4565ebe1d0c17a92e979c2159df30fc277bdd048a0c613
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.0rc1-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL hardware_address-1.0.0rc1-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
7fd553eef7f22eb3fa9f27613e45630bfd9431f83733430e6553dd1275ef92d9
BLAKE2b-256 checksum
How to use checksums
f537124c8928c3e62a9c358540a9b1a001b486197815125f816ed7216d6cd1ad
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.0rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hardware_address-1.0.0rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 251.6 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
19f1aa50f4b184cab2b66c201c78e0810e08107ef54b7d6f9c6c7172ee725b89
BLAKE2b-256 checksum
How to use checksums
a285ab7a614483e350500c9aa2ee31b8212618b71a5ed6411a7c998fd7c012b3
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.0rc1-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL hardware_address-1.0.0rc1-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
29567bb69f49d00e0f256b32de21f89311ac77cc4a6624e37b0fb1f87aa3bcca
BLAKE2b-256 checksum
How to use checksums
16182604ccdf4198b9c0acd965bc5de8811cfcce060190abd6b0f926c3ee82bb
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.0rc1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL hardware_address-1.0.0rc1-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
b1429751233810a69eaff5cc9551345158957581a0842281abb02475de109f00
BLAKE2b-256 checksum
How to use checksums
a1ee521d9c3b0a0efec0117deb1e9393ebb3aee654aeac4be6a117fcdca7cb17
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.0rc1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL hardware_address-1.0.0rc1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 242.5 kB
Tags CPython 3.8 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
2a8b1017b4455276d90652fd6c964abd52b9acc5a4f867c327dfb60f2af29638
BLAKE2b-256 checksum
How to use checksums
7aa4aeaa39d295f571cfd878a4ff8e7a391a5ec42af934ad372e87c9a0354c0f
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.0rc1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hardware_address-1.0.0rc1-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
89d47367bbb52c2f43ac4ece1a6b673a4aba451887468e121b46e294c1a8f834
BLAKE2b-256 checksum
How to use checksums
2492955b3d25c84f2ebf08270237826bf5274e59a517827723ef95e313aad215
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.0rc1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl

Download URL hardware_address-1.0.0rc1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Size 270.8 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-32 abi3
SHA-256 checksum
How to use checksums
748a2b45a5d538229787bba36fc53e32764e3254e1c04362e7d605ff3acead04
BLAKE2b-256 checksum
How to use checksums
cc07f86ac8349884430ab39eebd1d37bd15c8e47adcd3e98a8c1b129b666889e
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.0rc1-cp38-abi3-macosx_11_0_arm64.whl

Download URL hardware_address-1.0.0rc1-cp38-abi3-macosx_11_0_arm64.whl
Size 226.1 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1d7e3b2fcbfe33ed087576b0f699498ad9e062ad2e36c1c9f6ff4885ab34db51
BLAKE2b-256 checksum
How to use checksums
8177adf3d08ef1bac5437065b5b48b697194734ac05b089c6ec1fd3a134e1cca
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.0rc1-cp38-abi3-macosx_10_12_x86_64.whl

Download URL hardware_address-1.0.0rc1-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
b0ed3849f8ec32ce416728700f8a2f69195033fb7050f6c2855a3846272a73e2
BLAKE2b-256 checksum
How to use checksums
1b31f9ea0b321939a6b976c3bb54ee247618dc827663fe143be3134e16a73c8c
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.0rc1

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.0rc1.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