Skip to main content

ouilookup

PyPi Python Versions build tests License

A CLI tool and Python module for looking up hardware MAC addresses from the published OUI source list at ieee.org.

Project

Install

via PyPi

pip3 install ouilookup

Versions

Legacy versions based on year-date (eg v2018.2) have been hard-deprecated in favour of a backward incompatible standard versioning scheme (eg v0.2.0).

CLI usage

usage: ouilookup [-h] [-q [<hwaddr> ...] | -s | -u | -ul <filename>] [-d] [-df <data-file>]

ouilookup v0.3.0

options:
  -h, --help            show this help message and exit
  -q [<hwaddr> ...], --query [<hwaddr> ...]
                        Query to locate matching MAC hardware address(es) from 
                        the oui ouilookup.json data file. Addresses may be 
                        expressed in formats with or without ':' or '-' 
                        separators. Use a space or comma between addresses to 
                        query for more than one item in a single query.
  -s, --status          Return status metadata about the ouilookup.json data 
                        file.
  -u, --update          Download the latest from 
                        https://standards-oui.ieee.org/oui/oui.txt then parse 
                        and save as a ouilookup.json data file.
  -ul <filename>, --update-local <filename>
                        Supply a local oui.txt then parse and save as a 
                        ouilookup.json data file.

  -d, --debug           Enable debug logging
  -df <data-file>, --data-file <data-file>
                        Use a data file that is not in the default data file 
                        search paths: /home/<user>/.local/ouilookup, 
                        <package-path>/ouilookup/data, /var/lib/ouilookup

A CLI tool for interfacing with the OuiLookup module that provides CLI access 
the query(), update() and status() functions. Outputs at the CLI are JSON 
formatted allowing for easy chaining with other toolchains. The update() 
function updates directly from "standards-oui.ieee.org".

Python3 Module usage

>>> from OuiLookup import OuiLookup

>>> OuiLookup().query('00:00:aa:00:00:00')
[{'0000AA000000': 'XEROX CORPORATION'}]

>>> OuiLookup().query(['00:00:01:00:00:00','00-00-10-00-00-00','000011000000'])
[{'000001000000': 'XEROX CORPORATION'}, {'000010000000': 'SYTEK INC.'}, {'000011000000': 'NORMEREL SYSTEMES'}]

>>> OuiLookup().update()
{'timestamp': '2023-05-13T14:11:17+00:00', 'source_url': 'https://standards-oui.ieee.org/oui/oui.txt', 'source_data_file': '/tmp/ouilookup-qm5aq0dk/oui.txt', 'source_bytes': '5468392', 'source_md5': '55a434f90da0c24c1a4fcfefe5b2b64b', 'source_sha1': 'dd5e8849ab8c65b2fb12c4b5aef290afee6bbfcd', 'source_sha256': 'af7e4bb1394109f4faad814074d3a6d5b792078074549a5d554c0904612c0bfc', 'vendor_count': '33808', 'data_file': '~/.local/ouilookup/ouilookup.json'}
>>> OuiLookup().status()
{'timestamp': '2023-05-13T14:11:17+00:00', 'source_url': 'https://standards-oui.ieee.org/oui/oui.txt', 'source_data_file': '/tmp/ouilookup-qm5aq0dk/oui.txt', 'source_bytes': '5468392', 'source_md5': '55a434f90da0c24c1a4fcfefe5b2b64b', 'source_sha1': 'dd5e8849ab8c65b2fb12c4b5aef290afee6bbfcd', 'source_sha256': 'af7e4bb1394109f4faad814074d3a6d5b792078074549a5d554c0904612c0bfc', 'vendor_count': '33808', 'data_file': '~/.local/ouilookup/ouilookup.json'}

Authors

License

BSD-2-Clause - see LICENSE file for full details.

NB: License change from Apache-2.0 to BSD-2-Clause in February 2020 at version 0.2.0

Metadata

Release files for ouilookup 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ouilookup 0.3.1
File Size Uploaded
ouilookup-0.3.1.tar.gz 368.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ouilookup 0.3.1
File Interpreter ABI Platform
ouilookup-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 741.1 kB

Release files / ouilookup-0.3.1.tar.gz

Download URL ouilookup-0.3.1.tar.gz
Size 368.1 kB
Tags Source
SHA-256 checksum
How to use checksums
815010906bc34aa153b8ac7c76aaa831349a37d5abd15837bc408e69cd5f1766
BLAKE2b-256 checksum
How to use checksums
ce7f1d8ceacbe04d5f369d15fd3221884509edf23593a6c29ade81e83f2bc43b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.13 tqdm/4.64.0 importlib-metadata/4.6.4 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.6

Release files / ouilookup-0.3.1-py3-none-any.whl

Download URL ouilookup-0.3.1-py3-none-any.whl
Size 373.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55dad8477b1bc04d1f8c6b900b32899509ce10eab10be15886425432932baeb7
BLAKE2b-256 checksum
How to use checksums
83a72365180f5001403a39138fcff7e062dedf450513becb44222c9c8dd1b5e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.13 tqdm/4.64.0 importlib-metadata/4.6.4 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

1 release file

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page