pylibftdi


Namepylibftdi JSON
Version 0.22.0 PyPI version JSON
download
home_pagehttps://github.com/codedstructure/pylibftdi
SummaryPythonic interface to FTDI devices using libftdi.
upload_time2024-04-03 19:30:51
maintainerNone
docs_urlNone
authorBen Bass
requires_python>=3.7.0
licenseMIT
keywords ftdi libftdi usb
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pylibftdi
=========

pylibftdi is a minimal Pythonic interface to FTDI devices using libftdi_.

.. _libftdi: http://www.intra2net.com/en/developer/libftdi/

:Features:

 - No dependencies beyond standard library and a `libftdi` install.
 - Supports parallel and serial devices
 - Support for multiple devices
 - File-like interface wherever appropriate
 - Cross-platform

:Limitations:

 - The API might change prior to reaching a 1.0 release.

Usage
-----

The primary interface is the ``Device`` class in the pylibftdi package; this
gives serial access on relevant FTDI devices (e.g. the UM232R), providing a
file-like interface (read, write).  Baudrate is controlled with the ``baudrate``
property.

If a Device instance is created with ``mode='t'`` (text mode) then read() and
write() can use the given ``encoding`` (defaulting to latin-1). This allows
easier integration with passing unicode strings between devices.

Multiple devices are supported by passing the desired device serial number (as
a string) in the ``device_id`` parameter - this is the first parameter in both
Device() and BitBangDevice() constructors. Alternatively the device 'description'
can be given, and an attempt will be made to match this if matching by serial
number fails.

Examples
~~~~~~~~

::

    >>> from pylibftdi import Device
    >>>
    >>> with Device(mode='t') as dev:
    ...     dev.baudrate = 115200
    ...     dev.write('Hello World')

The pylibftdi.BitBangDevice wrapper provides access to the parallel IO mode of
operation through the ``port`` and ``direction`` properties.  These provide an
8 bit IO port including all the relevant bit operations to make things simple.

::

    >>> from pylibftdi import BitBangDevice
    >>>
    >>> with BitBangDevice('FTE00P4L') as bb:
    ...     bb.direction = 0x0F  # four LSB are output(1), four MSB are input(0)
    ...     bb.port |= 2         # set bit 1
    ...     bb.port &= 0xFE      # clear bit 0

There is support for a number of external devices and protocols, including
interfacing with HD44780 LCDs using the 4-bit interface.

History & Motivation
--------------------
This package is the result of various bits of work using FTDI's
devices, primarily for controlling external devices.  Some of this
is documented on the codedstructure blog, codedstructure.blogspot.com

Several other open-source Python FTDI wrappers exist, and each may be
best for some projects. Some aim at closely wrapping the libftdi interface,
others use FTDI's own D2XX driver (ftd2xx_) or talk directly to USB via
libusb or similar (such as pyftdi_).

.. _ftd2xx: http://pypi.python.org/pypi/ftd2xx
.. _pyftdi: https://github.com/eblot/pyftdi

The aim for pylibftdi is to work with libftdi, but to provide
a high-level Pythonic interface.  Various wrappers and utility
functions are also part of the distribution; following Python's
batteries included approach, there are various interesting devices
supported out-of-the-box - or at least there will be soon!

Plans
-----
 * Add more examples: SPI devices, knight-rider effects, input devices, MIDI...
 * Perhaps add support for D2XX driver, though the name then becomes a
   slight liability ;)

License
-------

Copyright (c) 2010-2023 Ben Bass <benbass@codedstructure.net>

pylibftdi is released under the MIT licence; see the file "LICENSE.txt"
for information.

All trademarks referenced herein are property of their respective
holders.
libFTDI itself is developed by Intra2net AG.  No association with
Intra2net is claimed or implied, but I have found their library
helpful and had fun with it...



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/codedstructure/pylibftdi",
    "name": "pylibftdi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7.0",
    "maintainer_email": null,
    "keywords": "ftdi, libftdi, usb",
    "author": "Ben Bass",
    "author_email": "benbass@codedstructure.net",
    "download_url": "https://files.pythonhosted.org/packages/74/b3/a3c333a250143d204a0bb60de7c1e5f841543231f04c71ff4fa65e5b90c2/pylibftdi-0.22.0.tar.gz",
    "platform": null,
    "description": "pylibftdi\n=========\n\npylibftdi is a minimal Pythonic interface to FTDI devices using libftdi_.\n\n.. _libftdi: http://www.intra2net.com/en/developer/libftdi/\n\n:Features:\n\n - No dependencies beyond standard library and a `libftdi` install.\n - Supports parallel and serial devices\n - Support for multiple devices\n - File-like interface wherever appropriate\n - Cross-platform\n\n:Limitations:\n\n - The API might change prior to reaching a 1.0 release.\n\nUsage\n-----\n\nThe primary interface is the ``Device`` class in the pylibftdi package; this\ngives serial access on relevant FTDI devices (e.g. the UM232R), providing a\nfile-like interface (read, write).  Baudrate is controlled with the ``baudrate``\nproperty.\n\nIf a Device instance is created with ``mode='t'`` (text mode) then read() and\nwrite() can use the given ``encoding`` (defaulting to latin-1). This allows\neasier integration with passing unicode strings between devices.\n\nMultiple devices are supported by passing the desired device serial number (as\na string) in the ``device_id`` parameter - this is the first parameter in both\nDevice() and BitBangDevice() constructors. Alternatively the device 'description'\ncan be given, and an attempt will be made to match this if matching by serial\nnumber fails.\n\nExamples\n~~~~~~~~\n\n::\n\n    >>> from pylibftdi import Device\n    >>>\n    >>> with Device(mode='t') as dev:\n    ...     dev.baudrate = 115200\n    ...     dev.write('Hello World')\n\nThe pylibftdi.BitBangDevice wrapper provides access to the parallel IO mode of\noperation through the ``port`` and ``direction`` properties.  These provide an\n8 bit IO port including all the relevant bit operations to make things simple.\n\n::\n\n    >>> from pylibftdi import BitBangDevice\n    >>>\n    >>> with BitBangDevice('FTE00P4L') as bb:\n    ...     bb.direction = 0x0F  # four LSB are output(1), four MSB are input(0)\n    ...     bb.port |= 2         # set bit 1\n    ...     bb.port &= 0xFE      # clear bit 0\n\nThere is support for a number of external devices and protocols, including\ninterfacing with HD44780 LCDs using the 4-bit interface.\n\nHistory & Motivation\n--------------------\nThis package is the result of various bits of work using FTDI's\ndevices, primarily for controlling external devices.  Some of this\nis documented on the codedstructure blog, codedstructure.blogspot.com\n\nSeveral other open-source Python FTDI wrappers exist, and each may be\nbest for some projects. Some aim at closely wrapping the libftdi interface,\nothers use FTDI's own D2XX driver (ftd2xx_) or talk directly to USB via\nlibusb or similar (such as pyftdi_).\n\n.. _ftd2xx: http://pypi.python.org/pypi/ftd2xx\n.. _pyftdi: https://github.com/eblot/pyftdi\n\nThe aim for pylibftdi is to work with libftdi, but to provide\na high-level Pythonic interface.  Various wrappers and utility\nfunctions are also part of the distribution; following Python's\nbatteries included approach, there are various interesting devices\nsupported out-of-the-box - or at least there will be soon!\n\nPlans\n-----\n * Add more examples: SPI devices, knight-rider effects, input devices, MIDI...\n * Perhaps add support for D2XX driver, though the name then becomes a\n   slight liability ;)\n\nLicense\n-------\n\nCopyright (c) 2010-2023 Ben Bass <benbass@codedstructure.net>\n\npylibftdi is released under the MIT licence; see the file \"LICENSE.txt\"\nfor information.\n\nAll trademarks referenced herein are property of their respective\nholders.\nlibFTDI itself is developed by Intra2net AG.  No association with\nIntra2net is claimed or implied, but I have found their library\nhelpful and had fun with it...\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Pythonic interface to FTDI devices using libftdi.",
    "version": "0.22.0",
    "project_urls": {
        "Documentation": "https://pylibftdi.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/codedstructure/pylibftdi",
        "Repository": "https://github.com/codedstructure/pylibftdi"
    },
    "split_keywords": [
        "ftdi",
        " libftdi",
        " usb"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "498fd48927d51d9dc87d3462ea83c953b7ca5c718f2e2b19feab20b63a24f0f1",
                "md5": "d3a0f84530dc3141d3eac85d7b3b321b",
                "sha256": "3a55c546a68dbe97e77f1866140756a2c88905bb60fcc6f06a8d42ba8c758bce"
            },
            "downloads": -1,
            "filename": "pylibftdi-0.22.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3a0f84530dc3141d3eac85d7b3b321b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.0",
            "size": 32982,
            "upload_time": "2024-04-03T19:30:49",
            "upload_time_iso_8601": "2024-04-03T19:30:49.992349Z",
            "url": "https://files.pythonhosted.org/packages/49/8f/d48927d51d9dc87d3462ea83c953b7ca5c718f2e2b19feab20b63a24f0f1/pylibftdi-0.22.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74b3a3c333a250143d204a0bb60de7c1e5f841543231f04c71ff4fa65e5b90c2",
                "md5": "a1d3039e8e09b3fb73cb03f1d6f3119b",
                "sha256": "85a6aab438f765342843aa2d59bb28fbb0d30847a621fb9800985185990f01af"
            },
            "downloads": -1,
            "filename": "pylibftdi-0.22.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a1d3039e8e09b3fb73cb03f1d6f3119b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.0",
            "size": 27956,
            "upload_time": "2024-04-03T19:30:51",
            "upload_time_iso_8601": "2024-04-03T19:30:51.542429Z",
            "url": "https://files.pythonhosted.org/packages/74/b3/a3c333a250143d204a0bb60de7c1e5f841543231f04c71ff4fa65e5b90c2/pylibftdi-0.22.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-03 19:30:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "codedstructure",
    "github_project": "pylibftdi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pylibftdi"
}
        
Elapsed time: 0.22339s