Skip to main content

generate mac addresses

Project description

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"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymacgen-1.0.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymacgen-1.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pymacgen-1.0.0.tar.gz.

File metadata

  • Download URL: pymacgen-1.0.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymacgen-1.0.0.tar.gz
Algorithm Hash digest
SHA256 489017f9819093a28495a5760f01b642c5893cd6d9f59b837c6aea314906a1c4
MD5 1bbd195943a1309822a9bbdd80e935f2
BLAKE2b-256 38d37b7415eee1b28c92ccf91f4974b783a64d3b28123d98dad14b7b974f4b11

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymacgen-1.0.0.tar.gz:

Publisher: publish.yml on nbdy/pymacgen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymacgen-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pymacgen-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymacgen-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc708e0bba66c4a8441f214649cbd3873b29f809c062e3633a692174b7e2b0af
MD5 b7c7d24799ecfc84324c6aa239228dc6
BLAKE2b-256 de1060bfbee9f25fceb6ce4741ba4b2cb36028b786ec87154a93d07b7a63ff85

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymacgen-1.0.0-py3-none-any.whl:

Publisher: publish.yml on nbdy/pymacgen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page