Skip to main content

Find the vendor for a given MAC address

Project description

Mac Vendor Lookup

This library provides an easy way to get vendor information from a MAC address. It downloads a local copy of the IEEE's OUI prefix list. It has an asynchronous interface using Python 3's asyncio as well as a regular synchronous interface for old-school usage.

Basic Usage

from mac_vendor_lookup import MacLookup

print(MacLookup().lookup("00:80:41:12:FE"))

Output:

VEB KOMBINAT ROBOTRON

Pre-load the vendor list

The list of MAC vendors is currently about 4MB large. By default a lazy-loading mechanism is used, that loads the list when it's needed. If it is clear that the list is needed and a wait time during the query is not desired, the list can also be loaded when the program is started:

from mac_vendor_lookup import MacLookup

mac = MacLookup()
mac.load_vendors()  # <- This can take a few seconds for the first download
    
def find_mac(mac_address):
    print(mac.lookup(mac_address))  # <- this will only take a few µs!

Async Interface

There is also an asynchronous interface available:

from mac_vendor_lookup import AsyncMacLookup

async def main():
    mac = AsyncMacLookup()
    print(await mac.lookup("98:ED:5C:FF:EE:01"))

Output:

Tesla Motors, Inc

Command line interface

This library provides a rudimentary command line interface:

$ mac_vendor_lookup 50-D3-7F-00-01-00
Yu Fly Mikly Way Science and Technology Co., Ltd.
$ python3 -m mac_vendor_lookup 00:26:12:12:FE
Space Exploration Technologies

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

mac_vendor_lookup-0.1.7.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

mac_vendor_lookup-0.1.7-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file mac_vendor_lookup-0.1.7.tar.gz.

File metadata

  • Download URL: mac_vendor_lookup-0.1.7.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using 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.6.7

File hashes

Hashes for mac_vendor_lookup-0.1.7.tar.gz
Algorithm Hash digest
SHA256 f44f9212cfaced34ff745846e45031f8a1e896d1798a87bb7676b9f89363608e
MD5 c1f7ecbeec4edca599956757b90a8c73
BLAKE2b-256 520f0230730354274e9a6e453f5de0d8410f080235c06b1bdcd3282892d65eac

See more details on using hashes here.

File details

Details for the file mac_vendor_lookup-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: mac_vendor_lookup-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using 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.6.7

File hashes

Hashes for mac_vendor_lookup-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 462caa62ae3d7461edf4032d79d5cd9d3e6510015b23362c4afd6bc1237afdca
MD5 308114ff52491ee550f5df25dceae1d7
BLAKE2b-256 ce4f2ba8db49d05aadf8ccb1eab9e6a7b6a22d4246894507dd8f0e494a971f66

See more details on using hashes here.

Supported by

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