circup icon indicating copy to clipboard operation
circup copied to clipboard

circup API?

Open plasticrake opened this issue 7 months ago • 1 comments

Hello!

I created a tool a few years ago that uses some non-public methods from circup (basically just device folder detection). When updating it recently I had to make changes as circup's internal code had changed.

The tool is circdeploy that copies project files from a code folder to a device. (I don't like editing the device files directly)

  1. Would it be possible to expose an official circup API that my tool could use instead of relying on non-public methods that may change?
  2. Or alternatively is the functionality in circdeploy something that you would be interested in having adding to circup?
  3. I'm pretty sure nobody but me uses circdeploy, as I've never advertised it. So I guess this is its debut!

Cheers!

plasticrake avatar May 03 '25 18:05 plasticrake

As far as detecting the USB drive goes, circup just looks for a drive named CIRCUITPY, there's no great magic to it. I don't know that there's a need for a public API for that. Note that circup now has wwshell, a tool to manage files via the web workflow if you want to do that too. But maybe it would be interesting to turn the backends into a separate public API, to make tools that can be agnostic to the type of backend used.

If you want, you can look into discotool, I made it specifically to be able to find microcontroller boards, including their serial port and drive no matter what its name is, on all platforms. It is both a command line tool and a python module. https://github.com/Neradoc/discotool?tab=readme-ov-file#module

Neradoc avatar May 03 '25 20:05 Neradoc