pymacgen
Generate MAC addresses from OUIs or prefixes.
Installation
- Using pip (PyPI):
- pip install pymacgen
- Using uv:
- uv add pymacgen
CLI
Run the built-in help to see available options:
pymacgen --help
Python usage
from pymacgen import MACGenerator
# these do not need instantiation of the MACGenerator class
print(MACGenerator.by_mac(str("EA:7B:EE:FB:01:42")))
print(MACGenerator.by_prefix("42:06:66"))
# these utilize the pyoui library, so instantiation of the MACGenerator class is needed
m = MACGenerator("/tmp/oui.txt", True)
# by company name examples
print(m.by_organization("national security agency"))
print(m.by_organization("samsung"))
# by country name examples
print(m.by_country_code("DE"))
print(m.by_country_code("CN"))
# by country code examples
print(m.by_country_name("Germany"))
print(m.by_country_name("China"))
Metadata
Release files for pymacgen 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymacgen-1.0.0.tar.gz | 17.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymacgen-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.0 kB
Release files / pymacgen-1.0.0.tar.gz
| Download URL | pymacgen-1.0.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
489017f9819093a28495a5760f01b642c5893cd6d9f59b837c6aea314906a1c4
|
|
BLAKE2b-256 checksum How to use checksums |
38d37b7415eee1b28c92ccf91f4974b783a64d3b28123d98dad14b7b974f4b11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 22, 2025.
Transparency logRelease files / pymacgen-1.0.0-py3-none-any.whl
| Download URL | pymacgen-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc708e0bba66c4a8441f214649cbd3873b29f809c062e3633a692174b7e2b0af
|
|
BLAKE2b-256 checksum How to use checksums |
de1060bfbee9f25fceb6ce4741ba4b2cb36028b786ec87154a93d07b7a63ff85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 22, 2025.
Transparency log