A module and utility to work with the simple filesystem on the BBC micro:bit
Project description
A community fork of MicroFS.
A simple command line tool and module for interacting with the limited file system provided by MicroPython on the BBC micro:bit.
Installation
To install simply type:
$ pip install microfs2
Usage
There are two ways to use microfs - as a module in your Python code or as a stand-alone command to use from your shell (ufs/microfs).
In Code
In your Python script import the required functions like this:
from microfs.lib import MicroBitSerial, ls, rm, cp, mv, cat, du, put, get, version, micropython_version
Read the API documentation below to learn how each of the functions works.
Command Line
From the command line use the ufs/microfs command.
To read the built-in help:
$ ufs --help
To see the version of microfs:
$ ufs --version
To set the device timeout (default is 10 seconds):
$ ufs --timeout 3 command
List the files on the device:
$ ufs ls
You can also specify a delimiter to separate file names displayed on the output (default is whitespace ‘ ‘):
# use ';' as a delimiter $ ufs ls ';'
Delete a file on the device:
$ ufs rm foo.txt
Copy a file from one location to another on the device:
$ ufs cp foo.txt bar.txt
Move a file from one location to another on the device:
$ ufs mv foo.txt bar.txt
Display the contents of a file on the device:
$ ufs cat foo.txt
Get the size of a file on the device in bytes:
$ ufs du foo.txt
Copy a file onto the device:
$ ufs put path/to/local.txt
Get a file from the device:
$ ufs get remote.txt
The put and get commands optionally take a further argument to specify the name of the target file:
$ ufs put /path/to/local.txt remote.txt $ ufs get remote.txt local.txt
Get information identifying the current operating system on the device:
$ ufs version
To show MicroPython version information only:
$ ufs version --micropython
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microfs2-2.0.7.tar.gz.
File metadata
- Download URL: microfs2-2.0.7.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26004519b938dda6074550bd62bc6c087452327bb00a17eec239ab56f406d480
|
|
| MD5 |
864c65ea02da0f265851f06f42949c17
|
|
| BLAKE2b-256 |
37e05d2068ff79c7cdc826a3e1f0a82752075a5dd1e7ed08c2d2ca9055adc56d
|
File details
Details for the file microfs2-2.0.7-py3-none-any.whl.
File metadata
- Download URL: microfs2-2.0.7-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
497da7038dfe61614b4673d183cf359fb3b82769a1f28ff97db895be89cef9cf
|
|
| MD5 |
5c47fe1e85b42c8830c5dac02f9d185d
|
|
| BLAKE2b-256 |
08e5db4f310c60cb2c05e9e3f72fd8fab209c5701f8466c608b07472f965c2a8
|