rstudio / pins-python

https://rstudio.github.io/pins-python/
MIT License
46 stars 10 forks source link

feat: pins cli #202

Open cpcloud opened 11 months ago

cpcloud commented 11 months ago

I find myself writing scripts to manage pins, but I think I'd rather do it on the command line.

Playing around with the API, it seems like the existing methods are fairly amenable to building one:

$ pins set-board ibis-pins  # store the board
$ pins list  # list all pins
$ pins search '*cars'  # list all pins matching a glob pattern
$ pins meta mtcars  # yaml or json blob to stdout
$ pins write mtcars mtcars.parquet --type=parquet
$ pins write mtcars mtcars.csv --type=file
$ pins read mtcars  # not entirely what this should do for non-`file` types
$ pins exists mtcars # exit 0 if exists otherwise exit 1

Is this something y'all are interested in?

cpcloud commented 11 months ago

I can take a crack at building a few of the commands and push up a PR for people to play with and evaluate whether to go further.

machow commented 11 months ago

Hey, thanks for opening this issue and the PR!

This looks like it could be really useful, and maybe follows a pattern I see across R and python: In cases where python folks might prefer to run CLI in the shell, R folks often want to run code in the RStudio IDE (e.g. usethis).

@isabelizimm is taking over as maintainer, so it might be a good idea to hold off on any big decisions for the next few weeks / get people's thoughts, but it seems like a really cool feature! (And IMO hitting at an important aspect of how python folks often like to work).

isabelizimm commented 11 months ago

Hello there 👋 a pins CLI would be welcomed! I think it's a great addition to this package. Especially as people are using this pins for tasks that are partially/wholly automated, it seems to fit the use case really well. Thanks for opening up that PR, I will check it out as I poke around and get acquainted in pins!