Skip to content
/ mac.py Public
forked from hustcc/mac.py

⚡A python lib to search Manufacturer of physical network card by mac address. 一个通过物理地址查询网卡所属厂商的Python库。

Notifications You must be signed in to change notification settings

lsyarn/mac.py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mac.py

A python lib to search Manufacturer of mac address. With method search. You can update the mac address dictionary with method update_dictionary_online from http://standards-oui.ieee.org/oui/oui.txt. Also, you can update the mac address dictionary with method update_dictionary offline.

一个用于利用物理地址查询网卡所属厂商的Python库,使用search方法进行查找。 可以使用update_dictionary_online方法从 http://standards-oui.ieee.org/oui/oui.txt 更新mac地址字典。 或者使用update_dictionary方法指定oui.txt文件对mac地址字典进行离线更新。

Build Status PyPi Status Python Versions PyPi Downloads

Install

pip install mac.py

Usage

from macpy import Mac

mac = Mac()
## run method update_dictionary_online ensures that you get the latest results
## Warging, that may take a long time ,depends on your network speed。
# mac.update_dictionary_online()
mac.search('00016C')
mac.search('00:01:6C:06:A6:29')
mac.search('00-01-6C-06-A6-29')
mac.search('00') # None
mac.search('') # None

Output

search result will be

{
	're': 'Brea  CA  92821', 
	'com': 'FOXCONN', 
	'addr': '105 S Puente St.', 
	'co': 'US'
}

or None

What's the meaning of result dict key:

  • com: company name
  • re: company region
  • addr: company address
  • co: company country

Online Search

Welcome to issue or pr.

About

⚡A python lib to search Manufacturer of physical network card by mac address. 一个通过物理地址查询网卡所属厂商的Python库。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.8%
  • Shell 2.2%