Skip to main content

generate mac addresses

Project description

generates mac addresses

how to..

… install

# from pypi
pip3 install pymacgen
# from github
pip3 install git+https://github.com/smthnspcl/pymacgen
# if this repo has been cloned
pip3 install .

… use from cli

pymacgen --help
usage: pymacgen [-h] [-o OUI] [-d] [-on ORGANIZATION_NAME] [-mp MAC_PREFIX] [-cn COUNTRY_NAME] [-g GENERATE]

optional arguments:
  -h, --help            show this help message and exit
  -o OUI, --oui OUI     path to oui file; will be downloaded if not found
  -d, --debug           enable debugging
  -on ORGANIZATION_NAME, --organization-name ORGANIZATION_NAME
                        search by organization name; case insensitive
  -mp MAC_PREFIX, --mac-prefix MAC_PREFIX
                        search by mac prefix; 00-00-00 or 00:00:00 or 000000
  -cn COUNTRY_NAME, --country-name COUNTRY_NAME
                        search by country name; case insensitive
  -g GENERATE, --generate GENERATE
                        generate a random mac address or by found prefix

… use from code

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-0.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distributions

pymacgen-0.3-py3.8.egg (3.4 kB view details)

Uploaded Source

pymacgen-0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymacgen-0.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pymacgen-0.3.tar.gz
Algorithm Hash digest
SHA256 e9a8496a379d734a116543495fab38028d5f0045ecc01551775305a7c0961a8a
MD5 6c2f9aedce4a3a9e60efd1c6632cf895
BLAKE2b-256 c44a496bece030014b68491a43261211c3e5722dfdbee322a26b4d7aad3556af

See more details on using hashes here.

File details

Details for the file pymacgen-0.3-py3.8.egg.

File metadata

  • Download URL: pymacgen-0.3-py3.8.egg
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pymacgen-0.3-py3.8.egg
Algorithm Hash digest
SHA256 f6ee12b1ada40dc88b86c982070f3948e26907942835b92984a3c4e4697d5a99
MD5 3ccbeb1420ba6038b452667f3489cade
BLAKE2b-256 e8cc56a98fb989c6ed8dc396129d8851a296d76398dfab6a50d68281f5e15fb9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymacgen-0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pymacgen-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 25da6d4497ce851e61c77bea2a6fd664254221918a6e7a7d5d8aa73c2945f6fa
MD5 936e299c50ddeac3c3bcdfb29949d3e6
BLAKE2b-256 933067a8affebe15b629a88b0730f3f5811f73bf58ee56e32ab3dcbead2213a1

See more details on using hashes here.

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