{ "info": { "author": "BlueDynamics Alliance", "author_email": "dev@bluedynamics.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Topic :: Software Development" ], "description": "USB file system abstraction API\n===============================\n\nThis module provides a USB file system abstraction API which can be used\nto gain information of the physical USB bus structure on a Linux System.\n\n.. note::\n\n Version 2.0 of this package is a complete rewrite. If you are using version\n 1.0.x of this package, you're encouraged adopting the new API.\n\n\nThe USB file system (Taken from http://www.linux-usb.org/FAQ.html)\n------------------------------------------------------------------\n\n::\n\n # ls /sys/bus/usb/devices/\n 1-0:1.0 1-1.3 1-1.3.1:1.0 1-1:1.0\n 1-1 1-1.3.1 1-1.3:1.0 usb1\n\nThe names that begin with \"usb\" refer to USB controllers. More accurately, they\nrefer to the \"root hub\" associated with each controller. The number is the USB\nbus number. In the example there is only one controller, so its bus is number\n1. Hence the name \"usb1\".\n\n\"1-0:1.0\" is a special case. It refers to the root hub's interface. This acts\njust like the interface in an actual hub an almost every respect; see below.\n\nAll the other entries refer to genuine USB devices and their interfaces.\nThe devices are named by a scheme like this::\n\n bus-port.port.port ...\n\nIn other words, the name starts with the bus number followed by a '-'. Then\ncomes the sequence of port numbers for each of the intermediate hubs along the\npath to the device.\n\nFor example, \"1-1\" is a device plugged into bus 1, port 1. It happens to be a\nhub, and \"1-1.3\" is the device plugged into port 3 of that hub. That device is\nanother hub, and \"1-1.3.1\" is the device plugged into its port 1.\n\nThe interfaces are indicated by suffixes having this form::\n\n :config.interface\n\nThat is, a ':' followed by the configuration number followed by '.' followed\nby the interface number. In the above example, each of the devices is using\nconfiguration 1 and this configuration has only a single interface, number 0.\nSo the interfaces show up as::\n\n 1-1:1.0 1-1.3:1.0 1-1.3.1:1.0\n\nA hub will never have more than a single interface; that's part of the USB\nspec. But other devices can and do have multiple interfaces (and sometimes\nmultiple configurations). Each interface gets its own entry in sysfs and can\nhave its own driver.\n\n\nUsage\n=====\n\nThe API consists of a USB root object, from which all children can be accessed\nlike python container types.\n\n.. code-block:: python\n\n >>> from usbid import USB\n >>> usb = USB()\n >>> usb\n \n\n >>> usb.keys()\n ['1', '2']\n\nGet a specific bus.\n\n.. code-block:: python\n\n >>> bus = usb['1']\n >>> bus\n \n\nGet port from bus.\n\n.. code-block:: python\n\n >>> port = bus['1']\n >>> port\n \n\nGet interface from port.\n\n.. code-block:: python\n\n >>> port.interfaces\n []\n\nInterfaces might have tty associated.\n\n.. code-block:: python\n\n >>> port.interfaces[0].tty\n 'ttyUSB0'\n\nIt's not a good idea to refer to a USB interface by its tty mount name. But\nit's a good idea to remember the file system name for unique identification,\nlookup interface by this name and then connect to corresponding tty.\n\n.. code-block:: python\n\n >>> interface = usb.get_interface('1-1:1.0')\n >>> interface.tty\n 'ttyUSB0'\n\nFor debugging you can print the USB structure.\n\n.. code-block:: python\n\n >>> usb.printtree()\n \n \n - Linux 3.13.0-48-generic xhci_hcd\n - xHCI Host Controller\n \n \n - FTDI\n - FT232R USB UART\n \n - ttyUSB0\n\n\nCoverage report\n===============\n\n::\n\n lines cov% module\n 4 100% usbid.__init__\n 248 100% usbid.fs\n 29 100% usbid.tests\n\n\nSource Code\n===========\n\nThe sources are in a GIT DVCS with its main branches at\n`github `_.\n\n\nContributors\n============\n\n- Robert Niederreiter \n\n- Jens W. Klein \n\n- Benjamin Stefaner \n\nHistory\n=======\n\n2.0\n---\n\n- Complete rewrite.\n [rnix, 2015-04-08]\n\n\n1.0.3\n-----\n\n- concrete ``ttyXXX`` device might live in ``tty`` subdirectory.\n [rnix, 2014-02-26]\n\n\n1.0.2\n-----\n\n- Rename ``usbid.device.devicelist`` to ``usbid.device.device_list``. B/C\n import available.\n [rnix, 2014-02-26]\n\n- Introduce ``usbid.device.device_by_path`` utility.\n [rnix, 2014-02-26]\n\n- use latest ``usb.id`` file version 2014.02.03 from \n http://www.linux-usb.org/usb.ids\n [jensens, 2014-02-20]\n\n\n1.0.1\n-----\n\n- fix device node hierarchy\n [rnix, 2014-02-17]\n\n- housekeeping, fix tests\n [rnix, 2014-02-17]\n\n\n1.0\n---\n\n- initial work\n [benniboy, jensens, 2013-12-19]\n\nLicense\n=======\n\nCopyright (c) 2013-2015, BlueDynamics Alliance, Austria, Germany, Switzerland\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this \n list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, this \n list of conditions and the following disclaimer in the documentation and/or \n other materials provided with the distribution.\n* Neither the name of the BlueDynamics Alliance nor the names of its \n contributors may be used to endorse or promote products derived from this \n software without specific prior written permission.\n \nTHIS SOFTWARE IS PROVIDED BY BlueDynamics Alliance ``AS IS`` AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL BlueDynamics Alliance BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/usbid", "keywords": "usb python", "license": "Simplified BSD", "maintainer": null, "maintainer_email": null, "name": "usbid", "package_url": "https://pypi.org/project/usbid/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/usbid/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/usbid" }, "release_url": "https://pypi.org/project/usbid/2.0/", "requires_dist": null, "requires_python": null, "summary": "USB file system API for Linux", "version": "2.0" }, "last_serial": 1496928, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c3a23b0df2e1e55b64b68fb05da8c197", "sha256": "c240a9fe048eedbdbe4bc2315455fd03290832951376714df94dd8d3cd11aa15" }, "downloads": -1, "filename": "usbid-1.0.tar.gz", "has_sig": false, "md5_digest": "c3a23b0df2e1e55b64b68fb05da8c197", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 256928, "upload_time": "2013-12-19T12:02:23", "url": "https://files.pythonhosted.org/packages/db/ef/1090faefe4582b5ef575fb438e99f319c71cf269369ba86c7d10958b04a4/usbid-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "04a9c12a33f1444eefa8a736ef5f4225", "sha256": "ca203594a3418e625cb597afe24cb5fce4cd035d587ba511eea6730144617b9f" }, "downloads": -1, "filename": "usbid-1.0.1.tar.gz", "has_sig": false, "md5_digest": "04a9c12a33f1444eefa8a736ef5f4225", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 257059, "upload_time": "2014-02-20T09:39:21", "url": "https://files.pythonhosted.org/packages/17/0a/b5d3cf96bfe2e6cedeb1c6c5a750f998b5b9fff97181af82940fa8eb536c/usbid-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "c621f5639e85cd255a4402ca580c5ea8", "sha256": "c1f12becddd4b73ad1c0d3c8f6df14802509705c3ebd6a1fa07e4cae5340bb2a" }, "downloads": -1, "filename": "usbid-1.0.2.tar.gz", "has_sig": false, "md5_digest": "c621f5639e85cd255a4402ca580c5ea8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 257933, "upload_time": "2014-02-26T09:47:40", "url": "https://files.pythonhosted.org/packages/1e/e7/dfd80c8f398b36ac286a6a95c6ac2033040a5377f82e2f4f272791934a3e/usbid-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "47f477d12a1d7bb6c71b452017dfb1c7", "sha256": "f596a775373b76de21a2ce3a92348c189d43a8cfd347b8b4cf2d1f47b9854969" }, "downloads": -1, "filename": "usbid-1.0.3.tar.gz", "has_sig": false, "md5_digest": "47f477d12a1d7bb6c71b452017dfb1c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 258059, "upload_time": "2014-03-03T09:32:59", "url": "https://files.pythonhosted.org/packages/78/67/0a93e2236cb1f82147f56840701be57041da5826a4bb090f3b57a79a3046/usbid-1.0.3.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "32c43f30d0a9f16163ee53f8e61aa783", "sha256": "5392d5ca705c7ce709e8ad09f9f052c224043b05bf6b58a0808dff372a758852" }, "downloads": -1, "filename": "usbid-2.0.tar.gz", "has_sig": false, "md5_digest": "32c43f30d0a9f16163ee53f8e61aa783", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 428164, "upload_time": "2015-04-09T08:21:24", "url": "https://files.pythonhosted.org/packages/be/9a/7c27f88ce8c612d5d7ff76d7015a3cb3712290e4d5d8a647bc4b16a58547/usbid-2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "32c43f30d0a9f16163ee53f8e61aa783", "sha256": "5392d5ca705c7ce709e8ad09f9f052c224043b05bf6b58a0808dff372a758852" }, "downloads": -1, "filename": "usbid-2.0.tar.gz", "has_sig": false, "md5_digest": "32c43f30d0a9f16163ee53f8e61aa783", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 428164, "upload_time": "2015-04-09T08:21:24", "url": "https://files.pythonhosted.org/packages/be/9a/7c27f88ce8c612d5d7ff76d7015a3cb3712290e4d5d8a647bc4b16a58547/usbid-2.0.tar.gz" } ] }