Skip to main content

Library for generating Ethernet MAC addresses

Project description


Python library for Generating Ethernet MAC addresses. Can use the wireshark manuf for specific vendors, and or a random, but assigned address. Will work with any file formated the same as said file.

Supported functions:

total_random() - Procedurely generated MAC address, using random function.

vid_file_random(file) - uses random line from wireshark's manuf file

vid_file_vendor(file, vendor name, desc=optional) - specify a vendor name, uses wireshark's manuf file instead of being completely random. May optionally specify desc, which searches description within the vendor field

vid_provided(vid bytes) - specify the VID bytes when calling the function. Random device bytes will be generated.

list_vendors(file) - return a python list [] with valid vendors

is_mac_address(mac) - Takes a string, and checks if it is a valid Ethernet MAC address. returns True or False(bool type)


Import and set up an object.

from generate_mac import generate_mac

Procedurely generated Vendor and Host bytes. Checks for broadcast bit


Read Vendor bytes from random line in a file. This has to be formated the same as wireshark's manuf file.


Read from a manuf file like above, but find Vendor bytes belonging to a specific vendor, by name.


OPTIONAL: this can also now search the description field


Provide the vendor bytes in a string. Generate Host bytes only


List valid vendor options as a list.


Check if a MAC address is valid. returns a Bool(True,False)


Get the VID bytes from a MAC address


Generate another MAC from the same VID bytes as current MAC


Project details

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

python_generate_mac-1.3.0-py3-none-any.whl (17.4 kB view hashes)

Uploaded Python 3

Supported by

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