Skip to main content

docs: https://mpy-repl-tool.readthedocs.io/en/latest

Transfer files via Python REPL (Read Evaluate Print Loop). This tool was developed to transfer files from and to MicroPython boards.

This is yet an other tool, there are now several similar tools but not all have the same features.

Key features of this one:

  • detect serial ports and MicroPython boards.

  • run temporary scripts.

  • pull get files and directories from the target filesystem.

  • push files and directories on the target filesystem.

  • mount target as filesystem (FUSE).

  • --interactive mode (terminal).

  • set RTC

  • All of the above, and more, via the serial REPL connection to a MicroPython board.

Usage

Here is the output of python3 -m there --help:

usage: __main__.py [-h] [-p PORT] [-b BAUDRATE] [--set-rtc]
                  [--reset-on-connect] [-c COMMAND] [-i] [--reset] [-u USER]
                  [-w PASSWORD] [-v] [--develop] [--timeit]
                  ACTION ...

Do stuff via the MicroPython REPL

optional arguments:
  -h, --help            show this help message and exit

port settings:
  -p PORT, --port PORT  set the serial port
  -b BAUDRATE, --baudrate BAUDRATE
                        set the baud rate

operations before running action:
  --set-rtc             set the RTC to "now" before command is executed
  --reset-on-connect    do a soft reset as first operation (main.py will not
                        be executed)

operations after running action:
  -c COMMAND, --command COMMAND
                        execute given code on target
  --command-timeout T   timeout in seconds for --command
  -i, --interactive     drop to interactive shell at the end
  --reset               do a soft reset on the end

login:
  -u USER, --user USER  response to login prompt
  -w PASSWORD, --password PASSWORD
                        response to password prompt

diagnostics:
  -v, --verbose         show diagnostic messages, repeat for more
  --develop             show tracebacks on errors (development of this tool)
  --timeit              measure command run time

subcommands:
  use "__main__.py ACTION --help" for more on each sub-command

  ACTION                sub-command help
    detect              help locating a board
    run                 execute file contents on target
    ls                  list files
    hash                hash files
    cat                 print contents of one file
    pull                file(s) to copy from target
    push                file(s) to copy onto target
    rm                  remove files from target
    df                  Show filesystem information
    mount               Make target files accessible via FUSE
    rtc                 Read the real time clock (RTC)

The -c option executes the given string after running all the actions. The -i option enters a miniterm session at the end of all other actions.

The tool automatically selects a USB port for communication, it may take the wrong one if multiple USB serial devices are connected. In that case, use there detect to list all devices and then -p PORT to specify the port to use on the other calls.

Use python3 -m there <action> --help to get help on sub-commands.

Requirements

This tool requires Python 3.

It depends on pySerial for communication and the mount function requires fusepy. Those dependencies are automatically installed when using pip, see installation notes in documentation.

Metadata

Release files for mpy-repl-tool 0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mpy-repl-tool 0.14
File Size Uploaded
mpy-repl-tool-0.14.tar.gz 37.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mpy-repl-tool 0.14
File Interpreter ABI Platform
mpy_repl_tool-0.14-py3-none-any.whl Python 3 none any Details

Total release size: 67.1 kB

Release files / mpy-repl-tool-0.14.tar.gz

Download URL mpy-repl-tool-0.14.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
58c06ae6f1686dda1b3948c4564ac6df6228f74da7838303a03a5243cec8b909
BLAKE2b-256 checksum
How to use checksums
b426b99dc586ef4e6fa598d0c71e3f3e9ca9e307423dc082a39a06149fe55585
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / mpy_repl_tool-0.14-py3-none-any.whl

Download URL mpy_repl_tool-0.14-py3-none-any.whl
Size 29.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c08104095058a43f8b78041ba65b99191dc3d46fc5807753df09b04ce1368685
BLAKE2b-256 checksum
How to use checksums
a4d403ce0035346d74377de77595b03a29ed408fac0b996f6045ce163186be53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.14 This release

2 release files

0.13

2 release files

0.12

2 release files

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page