{"id":6971,"library":"aiooui","title":"Async OUI Lookups","description":"aiooui offers an asynchronous approach to perform Organisationally Unique Identifier (OUI) lookups, enabling efficient identification of vendors based on MAC addresses in Python applications. It supports asynchronous programming models, making it suitable for use in modern Python asynchronous frameworks. The current version is 0.1.9, with a fairly active release cadence, frequently publishing minor updates and bug fixes.","status":"active","version":"0.1.9","language":"en","source_language":"en","source_url":"https://github.com/bluetooth-devices/aiooui","tags":["async","oui","mac address","vendor lookup","networking"],"install":[{"cmd":"pip install aiooui","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Runtime environment","package":"python","optional":false}],"imports":[{"symbol":"OUI","correct":"from aiooui import OUI"}],"quickstart":{"code":"import asyncio\nfrom aiooui import OUI\n\nasync def main():\n    oui = OUI()\n    mac_address = '00:08:DC:FF:FF:FF' # Example MAC address (Cisco)\n    vendor = await oui.lookup(mac_address)\n    print(f\"Vendor for {mac_address}: {vendor}\")\n    # Optionally, look up another known vendor\n    mac_address_2 = 'F8:F0:05:00:00:00' # Example MAC address (Apple)\n    vendor_2 = await oui.lookup(mac_address_2)\n    print(f\"Vendor for {mac_address_2}: {vendor_2}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())","lang":"python","description":"This quickstart demonstrates how to initialize the OUI lookup client and perform an asynchronous vendor lookup for a given MAC address. The `OUI` class handles fetching and caching OUI data. The example uses known MAC prefixes for demonstration."},"warnings":[{"fix":"Upgrade to `aiooui` v0.1.9 or newer. If issues persist, manually verify file permissions for the `aiooui` data directory in your Python environment or consider running in a WSL/Linux environment.","message":"On Windows systems, `aiooui` has historically faced issues loading OUI data due to pathing or permissions. Ensure your environment allows the library to download and access necessary data files.","severity":"gotcha","affected_versions":"<0.1.9"},{"fix":"Ensure a stable internet connection during installation and initial runs. If data loading fails, retry the operation. Version 0.1.8 and later include improved retry logic for data fetching.","message":"The library fetches OUI data from external sources. Intermittent network issues or server unavailability during installation or initial usage can lead to data loading failures. Earlier versions had less robust retry mechanisms.","severity":"gotcha","affected_versions":"<0.1.8"},{"fix":"Upgrade to `aiooui` v0.1.1 or later, which increased the timeout. For persistent issues, ensure sufficient network bandwidth and consider pre-downloading OUI data if the library supports it (check project documentation for advanced usage).","message":"Older versions of `aiooui` had a default timeout for fetching OUI data during the build process, which could be too short on slower connections or with large data files, leading to build failures.","severity":"gotcha","affected_versions":"<0.1.1"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure an active internet connection. If on Windows, update `aiooui` to the latest version (`pip install --upgrade aiooui`). Check your Python environment's permissions for writing to the package's data directory.","cause":"The OUI data file could not be downloaded or accessed, potentially due to network issues, file permissions, or an unsupported environment (e.g., Windows pathing issues in older versions).","error":"aiooui.exceptions.OUIError: Failed to load OUI data"},{"fix":"Always execute `aiooui` methods within an `async` function and run it using `asyncio.run(your_async_function())`. Avoid calling `await` outside an `async` context. If using a framework, ensure proper integration with its async features.","cause":"Attempting to run `aiooui`'s asynchronous functions outside of a running asyncio event loop, or after the loop has been explicitly closed, commonly occurs when mixing sync and async code improperly or when the event loop lifecycle isn't managed correctly.","error":"RuntimeError: Event loop is closed"}]}