按 mac、mac 前缀、组织名称或国家/地区查找 ieee 的 oui 表
项目描述
如何..
… 安装:
pip3 install pyoui
# master branch should be stable as well
pip3 install git+https://github.com/smthnspcl/pyoui
... 由 cli 使用:
pyoui --help
usage: pyoui [-h] [-o OUTFILE] [-d] [-p PREFIX] [-c COMPANY]
optional arguments:
-h, --help show this help message and exit
-o OUTFILE, --outfile OUTFILE
oui file which will be downloaded and read.
-d, --debug enable debugging
-p PREFIX, --prefix PREFIX
search by mac prefix
-c COMPANY, --company COMPANY
search by company name
…按代码使用:
from pyoui import OUI
entries = OUI(debug=True).parse()
print("entries:", entries.size())
e = next(entries.by_company("national security"))
print("company", e.company.__dict__, e.prefix)
e = next(entries.by_prefix("00:22:72"))
print("prefix", e.company.__dict__, e.prefix)
e = next(entries.by_mac("BC:23:92:42:42:42"))
print("mac", e.company.__dict__, e.prefix)
e = list(entries.by_country_code("US"))
print("length:", len(e))
print("first item:", e[0].prefix, e[0].company.__dict__)
ae = list(entries.by_country_name("United States"))
print("by country code length:", len(e), " | by name length:", len(ae))
print("lengths should be equal")
其他信息:
the csv folder was generated by obsolete/dump.py the folder obsolete is as the name implies, obsolete. all files in there are py2 and won't be refactored. the setup.py will only install the pyoui package.
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
pyoui-0.53.tar.gz
(3.7 kB
查看哈希)
内置发行版
pyoui-0.53-py3.8.egg
(4.0 kB
查看哈希)
pyoui-0.53-py3-none-any.whl
(5.8 kB
查看哈希)