adafruit-ampy


Nameadafruit-ampy JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/adafruit/ampy
Summaryampy (Adafruit MicroPython tool) is a command line tool to interact with a CircuitPython or MicroPython board over a serial connection.
upload_time2021-02-13 17:42:39
maintainer
docs_urlNone
authorAdafruit Industries
requires_python
licenseMIT
keywords adafruit ampy hardware micropython circuitpython
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ## ampy

MicroPython Tool (ampy) - Utility to interact with a CircuitPython or MicroPython board over a serial connection.

Ampy is meant to be a simple command line tool to manipulate files and run code on a CircuitPython or
MicroPython board over its serial connection.
With ampy you can send files from your computer to the
board's file system, download files from a board to your computer, and even send a Python script
to a board to be executed.

Note that ampy by design is meant to be simple and does not support advanced interaction like a shell
or terminal to send input to a board.  Check out other MicroPython tools
like [rshell](https://github.com/dhylands/rshell)
or [mpfshell](https://github.com/wendlers/mpfshell) for more advanced interaction with boards.

## Installation

You can use ampy with either Python 2.7.x or 3.x and can install it easily from
Python's package index.  On MacOS or Linux, in a terminal run the following command (assuming
Python 3):

    pip3 install --user adafruit-ampy

On Windows, do:

    pip install adafruit-ampy

Note on some Linux and Mac OSX systems you might need to run as root with sudo:

    sudo pip3 install adafruit-ampy

If you don't have Python 3 then try using Python 2 with:

    pip install adafruit-ampy

Once installed verify you can run the ampy program and get help output:

    ampy --help

You should see usage information displayed like below:

    Usage: ampy [OPTIONS] COMMAND [ARGS]...

      ampy - Adafruit MicroPython Tool

      Ampy is a tool to control MicroPython boards over a serial connection.
      Using ampy you can manipulate files on the board's internal filesystem and
      even run scripts.

    Options:
      -p, --port PORT  Name of serial port for connected board.  [required]
      -b, --baud BAUD  Baud rate for the serial connection. (default 115200)
      -d, --delay DELAY Delay in seconds before entering RAW MODE (default 0)
      --help           Show this message and exit.

    Commands:
      get  Retrieve a file from the board.
      ls   List contents of a directory on the board.
      put  Put a file on the board.
      rm   Remove a file from the board.
      run  Run a script and print its output.

If you'd like to install from the Github source then use the standard Python
setup.py install (or develop mode):

    python3 setup.py install

Note to run the unit tests on Python 2 you must install the mock library:

    pip install mock

## Usage

Ampy is made to talk to a CircuitPython MicroPython board over its serial connection.  You will
need your board connected and any drivers to access it serial port installed.
Then for example to list the files on the board run a command like:

    ampy --port /dev/tty.SLAB_USBtoUART ls

You should see a list of files on the board's root directory printed to the
terminal.  Note that you'll need to change the port parameter to the name or path
to the serial port that the MicroPython board is connected to.

Other commands are available, run ampy with --help to see more information:

    ampy --help

Each subcommand has its own help, for example to see help for the ls command  run (note you
unfortunately must have a board connected and serial port specified):

    ampy --port /dev/tty.SLAB_USBtoUART ls --help

## Configuration

For convenience you can set an `AMPY_PORT` environment variable which will be used
if the port parameter is not specified.  For example on Linux or OSX:

    export AMPY_PORT=/dev/tty.SLAB_USBtoUART
    ampy ls

Or on Windows (untested) try the SET command:

    set AMPY_PORT=COM4
    ampy ls

Similarly, you can set `AMPY_BAUD` and `AMPY_DELAY` to control your baud rate and
the delay before entering RAW MODE.

To set these variables automatically each time you run `ampy`, copy them into a
file named `.ampy`:

```sh
# Example .ampy file
# Please fill in your own port, baud rate, and delay
AMPY_PORT=/dev/cu.wchusbserial1410
AMPY_BAUD=115200
# Fix for macOS users' "Could not enter raw repl"; try 2.0 and lower from there:
AMPY_DELAY=0.5
```

You can put the `.ampy` file in your working directory, one of its parents, or in
your home directory.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/adafruit/ampy",
    "name": "adafruit-ampy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit ampy hardware micropython circuitpython",
    "author": "Adafruit Industries",
    "author_email": "circuitpython@adafruit.com",
    "download_url": "https://files.pythonhosted.org/packages/cb/4c/a06ed997ecd5d92115becf4689adfb904b1006e749831fde65593b27b638/adafruit-ampy-1.1.0.tar.gz",
    "platform": "",
    "description": "## ampy\n\nMicroPython Tool (ampy) - Utility to interact with a CircuitPython or MicroPython board over a serial connection.\n\nAmpy is meant to be a simple command line tool to manipulate files and run code on a CircuitPython or\nMicroPython board over its serial connection.\nWith ampy you can send files from your computer to the\nboard's file system, download files from a board to your computer, and even send a Python script\nto a board to be executed.\n\nNote that ampy by design is meant to be simple and does not support advanced interaction like a shell\nor terminal to send input to a board.  Check out other MicroPython tools\nlike [rshell](https://github.com/dhylands/rshell)\nor [mpfshell](https://github.com/wendlers/mpfshell) for more advanced interaction with boards.\n\n## Installation\n\nYou can use ampy with either Python 2.7.x or 3.x and can install it easily from\nPython's package index.  On MacOS or Linux, in a terminal run the following command (assuming\nPython 3):\n\n    pip3 install --user adafruit-ampy\n\nOn Windows, do:\n\n    pip install adafruit-ampy\n\nNote on some Linux and Mac OSX systems you might need to run as root with sudo:\n\n    sudo pip3 install adafruit-ampy\n\nIf you don't have Python 3 then try using Python 2 with:\n\n    pip install adafruit-ampy\n\nOnce installed verify you can run the ampy program and get help output:\n\n    ampy --help\n\nYou should see usage information displayed like below:\n\n    Usage: ampy [OPTIONS] COMMAND [ARGS]...\n\n      ampy - Adafruit MicroPython Tool\n\n      Ampy is a tool to control MicroPython boards over a serial connection.\n      Using ampy you can manipulate files on the board's internal filesystem and\n      even run scripts.\n\n    Options:\n      -p, --port PORT  Name of serial port for connected board.  [required]\n      -b, --baud BAUD  Baud rate for the serial connection. (default 115200)\n      -d, --delay DELAY Delay in seconds before entering RAW MODE (default 0)\n      --help           Show this message and exit.\n\n    Commands:\n      get  Retrieve a file from the board.\n      ls   List contents of a directory on the board.\n      put  Put a file on the board.\n      rm   Remove a file from the board.\n      run  Run a script and print its output.\n\nIf you'd like to install from the Github source then use the standard Python\nsetup.py install (or develop mode):\n\n    python3 setup.py install\n\nNote to run the unit tests on Python 2 you must install the mock library:\n\n    pip install mock\n\n## Usage\n\nAmpy is made to talk to a CircuitPython MicroPython board over its serial connection.  You will\nneed your board connected and any drivers to access it serial port installed.\nThen for example to list the files on the board run a command like:\n\n    ampy --port /dev/tty.SLAB_USBtoUART ls\n\nYou should see a list of files on the board's root directory printed to the\nterminal.  Note that you'll need to change the port parameter to the name or path\nto the serial port that the MicroPython board is connected to.\n\nOther commands are available, run ampy with --help to see more information:\n\n    ampy --help\n\nEach subcommand has its own help, for example to see help for the ls command  run (note you\nunfortunately must have a board connected and serial port specified):\n\n    ampy --port /dev/tty.SLAB_USBtoUART ls --help\n\n## Configuration\n\nFor convenience you can set an `AMPY_PORT` environment variable which will be used\nif the port parameter is not specified.  For example on Linux or OSX:\n\n    export AMPY_PORT=/dev/tty.SLAB_USBtoUART\n    ampy ls\n\nOr on Windows (untested) try the SET command:\n\n    set AMPY_PORT=COM4\n    ampy ls\n\nSimilarly, you can set `AMPY_BAUD` and `AMPY_DELAY` to control your baud rate and\nthe delay before entering RAW MODE.\n\nTo set these variables automatically each time you run `ampy`, copy them into a\nfile named `.ampy`:\n\n```sh\n# Example .ampy file\n# Please fill in your own port, baud rate, and delay\nAMPY_PORT=/dev/cu.wchusbserial1410\nAMPY_BAUD=115200\n# Fix for macOS users' \"Could not enter raw repl\"; try 2.0 and lower from there:\nAMPY_DELAY=0.5\n```\n\nYou can put the `.ampy` file in your working directory, one of its parents, or in\nyour home directory.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "ampy (Adafruit MicroPython tool) is a command line tool to interact with a CircuitPython or MicroPython board over a serial connection.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/ampy"
    },
    "split_keywords": [
        "adafruit",
        "ampy",
        "hardware",
        "micropython",
        "circuitpython"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3877749376a6162d49f11141f9441fe74647626503ae60f493533212aa500e0",
                "md5": "033ac91804a970950f61eeaf493bdaa5",
                "sha256": "4a74812226e53c17d01eb828633424bc4f4fe76b9499a7b35eba6fc2532635b7"
            },
            "downloads": -1,
            "filename": "adafruit_ampy-1.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "033ac91804a970950f61eeaf493bdaa5",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 16873,
            "upload_time": "2021-02-13T17:42:37",
            "upload_time_iso_8601": "2021-02-13T17:42:37.467916Z",
            "url": "https://files.pythonhosted.org/packages/a3/87/7749376a6162d49f11141f9441fe74647626503ae60f493533212aa500e0/adafruit_ampy-1.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb4ca06ed997ecd5d92115becf4689adfb904b1006e749831fde65593b27b638",
                "md5": "4ec0a6cc3105c38dc06d5308a58ad63d",
                "sha256": "f4cba36f564096f2aafd173f7fbabb845365cc3bb3f41c37541edf98b58d3976"
            },
            "downloads": -1,
            "filename": "adafruit-ampy-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4ec0a6cc3105c38dc06d5308a58ad63d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17900,
            "upload_time": "2021-02-13T17:42:39",
            "upload_time_iso_8601": "2021-02-13T17:42:39.363859Z",
            "url": "https://files.pythonhosted.org/packages/cb/4c/a06ed997ecd5d92115becf4689adfb904b1006e749831fde65593b27b638/adafruit-ampy-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-02-13 17:42:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adafruit",
    "github_project": "ampy",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "adafruit-ampy"
}
        
Elapsed time: 0.10130s