xmodem


Namexmodem JSON
Version 0.4.7 PyPI version JSON
download
home_pagehttps://github.com/tehmaze/xmodem
SummaryXMODEM protocol implementation.
upload_time2023-06-11 18:02:42
maintainer
docs_urlhttps://pythonhosted.org/xmodem/
authorWijnand Modderman, Jeff Quast, Kris Hardy
requires_python
licenseMIT
keywords xmodem protocol
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            .. image:: https://travis-ci.org/tehmaze/xmodem.png?branch=master
   :target: https://travis-ci.org/tehmaze/xmodem

.. image:: https://coveralls.io/repos/tehmaze/xmodem/badge.png
   :target: https://coveralls.io/r/tehmaze/xmodem

================================
 XMODEM protocol implementation
================================

Documentation available at http://packages.python.org/xmodem/

Python Package Index (PyPI) page is available at https://pypi.python.org/pypi/xmodem

Usage
=====

Create a function to get and put character data (to a serial line for
example)::

    >>> import serial
    >>> from xmodem import XMODEM
    >>> ser = serial.Serial('/dev/ttyUSB0', timeout=0) # or whatever port you need
    >>> def getc(size, timeout=1):
    ...     return ser.read(size) or None
    ...
    >>> def putc(data, timeout=1):
    ...     return ser.write(data)  # note that this ignores the timeout
    ...
    >>> modem = XMODEM(getc, putc)

Now, to upload a file, use the ``send`` method::

    >>> stream = open('/etc/fstab', 'rb')
    >>> modem.send(stream)

To download a file, use the ``recv`` method::

    >>> stream = open('output', 'wb')
    >>> modem.recv(stream)

For more information, take a look at the documentation_.

.. _documentation: http://packages.python.org/xmodem/xmodem.html

Changes
=======
0.4.7:
   * bugfix: stall on some kinds of error in ``recv()``, `PR #56
     <https://github.com/tehmaze/xmodem/pull/56>`_.
   * bugfix: sequence number miscalculation in ``send()``, `PR #52
     <https://github.com/tehmaze/xmodem/pull/52>`_.
   * enhancement: callback function added for ``recv()``, `PR #53
     <https://github.com/tehmaze/xmodem/pull/53>`_.
   * bugfix: receiving empty file and stall condition in ``recv()``, `PR #50
     <https://github.com/tehmaze/xmodem/pull/50>`_.
   * bugfix: callback is now called for some kinds of errors
     and some CLI fixes, `8a798e8b
     <https://github.com/tehmaze/xmodem/commit/8a798e8b2af2a9cd6f9e789ef154a23a6467f98b>`_.
   * bugfix: remove DepreactionWarning for ``logging.warn()``, `PR #49
     <https://github.com/tehmaze/xmodem/pull/49>`_.

0.4.6:
  * bugfix: Abort send on EOT in startup-sequence `Issue #34 
    <https://github.com/tehmaze/xmodem/issues/34>`_.
  * enhancement: Include LICENSE file in the source distribution.

0.4.5:
  * bugfix: Remove bogus `assert False` code in ``recv()`` that resulted in
    `AssertionError` introduced in version 0.4.0 commit-id `9b03fc20`, `PR #29
    <https://github.com/tehmaze/xmodem/pull/29>`_.

0.4.4:
  * bugfix: Large file transfers in ``send()`` were more likely to fail for
    small values of ``retry``: This value should be the maximum failures per
    block transfer as documented, but was improperly implemented as the number
    of failures allowed for the total duration of the transfer, `PR #21
    <https://github.com/tehmaze/xmodem/pull/21>`_.
  * bugfix: ``send(retry=n)`` and ``recv(retry=n)`` should retry ``n`` times
    as documented, was retrying ``n - 1``.

0.4.3:
  * bugfix: ``putc()`` callback was called in series, 3 times for each part of
    xmodem block header, data, and checksum during block transfer.  Now all
    three data blocks are sent by single ``putc()`` call.  This resolves issues
    when integrating with microcontrollers or equipment sensitive to timing
    issues at stream boundaries, `PR #19
    <https://github.com/tehmaze/xmodem/pull/19>`_.

0.4.2:
  * bugfix: documentation files missing from the release tarball
    `Issue #16 <https://github.com/tehmaze/xmodem/issues/16>`_.

0.4.1
  * bugfix: re-transmit in ``send()`` on ``NAK`` or timeout, previously
    re-transmissions (wrongly) occurred only on garbage bytes.
    `PR #12 <https://github.com/tehmaze/xmodem/pull/12>`_.

0.4.0
  * enhancement: support for python 3
    `PR #8 <https://github.com/tehmaze/xmodem/pull/8>`_.
  * bugfix: CRC failures in XMODEM.recv() were not renegotiated correctly
    `PR #11 <https://github.com/tehmaze/xmodem/issues/11>`_.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tehmaze/xmodem",
    "name": "xmodem",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/xmodem/",
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "xmodem protocol",
    "author": "Wijnand Modderman, Jeff Quast, Kris Hardy",
    "author_email": "maze@pyth0n.org",
    "download_url": "https://files.pythonhosted.org/packages/3d/17/fd6668a09afdc46c22990172b6f65e07dfb5bcf38960d063a7a887ca926d/xmodem-0.4.7.tar.gz",
    "platform": null,
    "description": ".. image:: https://travis-ci.org/tehmaze/xmodem.png?branch=master\n   :target: https://travis-ci.org/tehmaze/xmodem\n\n.. image:: https://coveralls.io/repos/tehmaze/xmodem/badge.png\n   :target: https://coveralls.io/r/tehmaze/xmodem\n\n================================\n XMODEM protocol implementation\n================================\n\nDocumentation available at http://packages.python.org/xmodem/\n\nPython Package Index (PyPI) page is available at https://pypi.python.org/pypi/xmodem\n\nUsage\n=====\n\nCreate a function to get and put character data (to a serial line for\nexample)::\n\n    >>> import serial\n    >>> from xmodem import XMODEM\n    >>> ser = serial.Serial('/dev/ttyUSB0', timeout=0) # or whatever port you need\n    >>> def getc(size, timeout=1):\n    ...     return ser.read(size) or None\n    ...\n    >>> def putc(data, timeout=1):\n    ...     return ser.write(data)  # note that this ignores the timeout\n    ...\n    >>> modem = XMODEM(getc, putc)\n\nNow, to upload a file, use the ``send`` method::\n\n    >>> stream = open('/etc/fstab', 'rb')\n    >>> modem.send(stream)\n\nTo download a file, use the ``recv`` method::\n\n    >>> stream = open('output', 'wb')\n    >>> modem.recv(stream)\n\nFor more information, take a look at the documentation_.\n\n.. _documentation: http://packages.python.org/xmodem/xmodem.html\n\nChanges\n=======\n0.4.7:\n   * bugfix: stall on some kinds of error in ``recv()``, `PR #56\n     <https://github.com/tehmaze/xmodem/pull/56>`_.\n   * bugfix: sequence number miscalculation in ``send()``, `PR #52\n     <https://github.com/tehmaze/xmodem/pull/52>`_.\n   * enhancement: callback function added for ``recv()``, `PR #53\n     <https://github.com/tehmaze/xmodem/pull/53>`_.\n   * bugfix: receiving empty file and stall condition in ``recv()``, `PR #50\n     <https://github.com/tehmaze/xmodem/pull/50>`_.\n   * bugfix: callback is now called for some kinds of errors\n     and some CLI fixes, `8a798e8b\n     <https://github.com/tehmaze/xmodem/commit/8a798e8b2af2a9cd6f9e789ef154a23a6467f98b>`_.\n   * bugfix: remove DepreactionWarning for ``logging.warn()``, `PR #49\n     <https://github.com/tehmaze/xmodem/pull/49>`_.\n\n0.4.6:\n  * bugfix: Abort send on EOT in startup-sequence `Issue #34 \n    <https://github.com/tehmaze/xmodem/issues/34>`_.\n  * enhancement: Include LICENSE file in the source distribution.\n\n0.4.5:\n  * bugfix: Remove bogus `assert False` code in ``recv()`` that resulted in\n    `AssertionError` introduced in version 0.4.0 commit-id `9b03fc20`, `PR #29\n    <https://github.com/tehmaze/xmodem/pull/29>`_.\n\n0.4.4:\n  * bugfix: Large file transfers in ``send()`` were more likely to fail for\n    small values of ``retry``: This value should be the maximum failures per\n    block transfer as documented, but was improperly implemented as the number\n    of failures allowed for the total duration of the transfer, `PR #21\n    <https://github.com/tehmaze/xmodem/pull/21>`_.\n  * bugfix: ``send(retry=n)`` and ``recv(retry=n)`` should retry ``n`` times\n    as documented, was retrying ``n - 1``.\n\n0.4.3:\n  * bugfix: ``putc()`` callback was called in series, 3 times for each part of\n    xmodem block header, data, and checksum during block transfer.  Now all\n    three data blocks are sent by single ``putc()`` call.  This resolves issues\n    when integrating with microcontrollers or equipment sensitive to timing\n    issues at stream boundaries, `PR #19\n    <https://github.com/tehmaze/xmodem/pull/19>`_.\n\n0.4.2:\n  * bugfix: documentation files missing from the release tarball\n    `Issue #16 <https://github.com/tehmaze/xmodem/issues/16>`_.\n\n0.4.1\n  * bugfix: re-transmit in ``send()`` on ``NAK`` or timeout, previously\n    re-transmissions (wrongly) occurred only on garbage bytes.\n    `PR #12 <https://github.com/tehmaze/xmodem/pull/12>`_.\n\n0.4.0\n  * enhancement: support for python 3\n    `PR #8 <https://github.com/tehmaze/xmodem/pull/8>`_.\n  * bugfix: CRC failures in XMODEM.recv() were not renegotiated correctly\n    `PR #11 <https://github.com/tehmaze/xmodem/issues/11>`_.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "XMODEM protocol implementation.",
    "version": "0.4.7",
    "project_urls": {
        "Homepage": "https://github.com/tehmaze/xmodem"
    },
    "split_keywords": [
        "xmodem",
        "protocol"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "676b371c541d67e926d7e87e47aaa7117f8d30ac13dd16e64f9ac2ffdcdead44",
                "md5": "caf320a0d526aaaba338016d1743c645",
                "sha256": "0842d2266175f01225053db721ea952b3f4b239cb3ace83c32b1daf90aa413af"
            },
            "downloads": -1,
            "filename": "xmodem-0.4.7-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "caf320a0d526aaaba338016d1743c645",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 35626,
            "upload_time": "2023-06-11T18:02:38",
            "upload_time_iso_8601": "2023-06-11T18:02:38.583825Z",
            "url": "https://files.pythonhosted.org/packages/67/6b/371c541d67e926d7e87e47aaa7117f8d30ac13dd16e64f9ac2ffdcdead44/xmodem-0.4.7-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c1ae383b538450963953d4e652d2bce0a4cfbcf15ecc8c34ab998bd1329c95d",
                "md5": "bee0eec41255a94c8d9364f9d2572d6a",
                "sha256": "e6a2c7608f7b187da786c47780f8407dbc4ac2d3dfeb34fe683cc19778f01360"
            },
            "downloads": -1,
            "filename": "xmodem-0.4.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bee0eec41255a94c8d9364f9d2572d6a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 35689,
            "upload_time": "2023-06-11T18:02:40",
            "upload_time_iso_8601": "2023-06-11T18:02:40.845330Z",
            "url": "https://files.pythonhosted.org/packages/8c/1a/e383b538450963953d4e652d2bce0a4cfbcf15ecc8c34ab998bd1329c95d/xmodem-0.4.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d17fd6668a09afdc46c22990172b6f65e07dfb5bcf38960d063a7a887ca926d",
                "md5": "0a21c269cb4d3995d13a2615c24fed0a",
                "sha256": "2f1068aa8676f0d1d112498b5786c4f8ea4f89d8f25d07d3a0f293cd21db1c35"
            },
            "downloads": -1,
            "filename": "xmodem-0.4.7.tar.gz",
            "has_sig": false,
            "md5_digest": "0a21c269cb4d3995d13a2615c24fed0a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 34052,
            "upload_time": "2023-06-11T18:02:42",
            "upload_time_iso_8601": "2023-06-11T18:02:42.897947Z",
            "url": "https://files.pythonhosted.org/packages/3d/17/fd6668a09afdc46c22990172b6f65e07dfb5bcf38960d063a7a887ca926d/xmodem-0.4.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-11 18:02:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tehmaze",
    "github_project": "xmodem",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "xmodem"
}
        
Elapsed time: 0.07797s