Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli version #60

Open
jamesmyatt opened this issue Oct 19, 2020 · 5 comments
Open

cli version #60

jamesmyatt opened this issue Oct 19, 2020 · 5 comments

Comments

@jamesmyatt
Copy link
Contributor

I think it would be useful to have a CLI version for this for non-Python kernels and for Python kernels that don't support magics.

For example, in an R notebook, you could write:

system("watermark")

and get the same as %watermark in IPython.

The obvious problem being that it will show the versions of the relevant Python packages, like CPython and IPython, by default, but I think that's OK for a first iteration, and we can just recommend including some flags instead.

What do you think?

@rasbt
Copy link
Owner

rasbt commented Oct 19, 2020

I agree, adding CLI support sounds like a good idea to me.

Regarding RMardkown or R notebooks, I use RMarkdown occasionally for R, but I have no idea how to develop it, but I would welcome PRs.

@jamesmyatt
Copy link
Contributor Author

jamesmyatt commented Oct 19, 2020

I'll try to make a PR for this. It won't depend on R at all, but I am planning to use click: https://click.palletsprojects.com/en/7.x/

@rasbt
Copy link
Owner

rasbt commented Feb 17, 2021

Regarding click, is this still commonly used? I remember that some time ago some people recommended it over argparse but personally, I have never had any issues over argparse -- on the contrary, it's one fewer dependency. What are your thoughts about it?

@jamesmyatt
Copy link
Contributor Author

I think click is quite widely used. But I can't remember some examples of the top of my head.

click will let you build more complex applications and has a more modern API than argparse but should still give you the same basic functionality. At least that's what I expect.

@rasbt
Copy link
Owner

rasbt commented Feb 21, 2021

Sounds good! I mainly never used it because from a user perspective, the command line use looks exactly like argparse so I thought why adding another dependency. But I am open to using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants