MadMAC 
MAC address generator library for testers.
Content
Installation
Using pip:
pip install madmac
Using source:
$ git clone https://github.com/laminko/madmac.git
$ cd madmac
$ python setup.py install
Usage
As a command
Can be used madmac as command. The following will generate random MAC address.
madmac
To see help, enter madmac --help.
madmac --help
usage: madmac [-h] [-o OUI] [-r START] [-s STOP] [-t TOTAL] [-d DELIMITER]
[-c CASE]
MAC address generator library for testers.
optional arguments:
-h, --help show this help message and exit
-o OUI, --oui OUI 6-digit organizationally unique identifier
-r START, --start START
NIC specific start address
-s STOP, --stop STOP NIC specific end address
-t TOTAL, --total TOTAL
Number of MACs to generate
-d DELIMITER, --delimiter DELIMITER
Delimiter for MAC address
-c CASE, --case CASE Use lower or upper
NOTE:
madmacis not a binary file. You need to install python 3.5 to execute the command.
As a module
Import MacGenerator class from madmac module. And create an object using MacGenerator and call its member generate() function. generate() function will return python generator object.
The following code will generate single MAC address using default values.
from madmac import MacGenerator
macg = MacGenerator()
macs = macg.generate() # generator object which contains one item
from pprint import pprint
pprint(list(macs))
Default values are as follows:
# 'oui': None,
# 'start': None,
# 'stop': None,
# 'total': 1,
# 'delimiter': ':',
# 'case': 'lower'
One can provide oui:
from madmac import MacGenerator
macg = MacGenerator(oui='F0-9F-C2')
list(macg.generate())
Also specify start address and end address if they are known:
from madmac import MacGenerator
start = '00-B0-A0'
stop = '00-B0-DF'
macg = MacGenerator(start=start, stop=stop)
NOTE: Above snippet describes to use random
oui, but to use certain range fromstartandstopvalues. It will ignoretotalparameter. Delimiter and Case will be default values.
Sometimes, we might want to generate certain amount of MAC addresses:
from madmac import MacGenerator
macg = MacGenerator(total=100)
Metadata
Release files for madmac 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| madmac-1.0.1.tar.gz | 5.4 kB | Without provenance | Details for madmac-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| madmac-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for madmac-1.0.1-py3-none-any.whl |
Total release size: 10.6 kB
Release files / madmac-1.0.1.tar.gz
| Download URL | madmac-1.0.1.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06b581352f827280c57e0f35282c635439eb98e9cfab9ed517fbade4db2acc9b
|
|
BLAKE2b-256 checksum How to use checksums |
862c3867b95f154f48164d927ef45f43e0d0d62ecf7ab099edb131caf4507bbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.6
|
Release files / madmac-1.0.1-py3-none-any.whl
| Download URL | madmac-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af4da44b9d586fb176af6cc6a42ea0bda5408f247b6376714f1bebc7d968aaf7
|
|
BLAKE2b-256 checksum How to use checksums |
dbedc41925b65b172728971c8e3618ff23dcb9d03218ac70fea846018f061f00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.6
|
Security for madmac 1.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.