mpremote-path: A new pathlib-compatible interface for remotely accessing and manipulating files on a micropython board. #13657
Unanswered
glenn20
asked this question in
Libraries & Drivers
Replies: 1 comment 1 reply
-
|
Interesting, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted a convenient and powerful method for accessing and manipulating files on a micropython board from python programs on my host computer. I like to use the python
pathlibmodule to work with files on my computer, so I built apathlib.Pathcompatible interface, based on features provided bympremote.If this may be useful to you, please feel free to investigate further at https://github.com/glenn20/mpremote-path. If you have question, ideas or requests for extension post them here or feel welcome to post issues at https://github.com/glenn20/mpremote-path/issues.
It is working well for me and I have gone to some lengths to make it work as seamlessly as possible with
pathlib.There are a few TODOs in the works, including caching remote file status queries which really improves the performace for common operations. There are also a few utility modules for performing common file operations (
mpremote_path.util.mpfsandmpremote_path.util.mpfsops). There is some preliminary documentation for those in the README.md.Of course, this is only possible because of the capabilities provided by the modules packaged in
mpremote(ie. theSerialTransportclass).From the README
mpremote-pathprovides a convenient,pathlib.Pathcompatible interface to access and manipulate files on a serial-attached micropython board from the host computer.Provides the
MPRemotePathclass:following the familiar
pathlib.Pathinterface:pathlib.PosixPathclass, so code which works onPathobjects willalso work transparently on
MPRemotePathobjects, eg:Beta Was this translation helpful? Give feedback.
All reactions