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

Idea: imports match CLI? #1112

Open
luizirber opened this issue Jul 18, 2020 · 2 comments
Open

Idea: imports match CLI? #1112

luizirber opened this issue Jul 18, 2020 · 2 comments
Labels

Comments

@luizirber
Copy link
Member

So, this occurred to me yesterday: What if we make the Python API look like the CLI?

Let's say I want to call sourmash sig describe <sig> in Python. I'm not even sure how to do it now, but it would be nice to do

import sourmash

sourmash.sig.describe(sig)

Of course, this would mess our current API completely...

Maybe an alternative would be to have a submodule to do that, kinda sorta like matplotlib.pyplot? So we could do

import sourmash.api as sm

sm.sig.describe(sig)

(api and sm up for discussion, obviously).

This would solve #245 too.

@luizirber luizirber added the idea label Jul 18, 2020
@ctb
Copy link
Contributor

ctb commented Jul 20, 2020

I like this, especially the submodule approach. It's actually fairly straightforward given the massive CLI reorganization that @standage did in #785 - note that others have already chosen smash as the import for sourmash 🤷

@luizirber
Copy link
Member Author

I like this, especially the submodule approach. It's actually fairly straightforward given the massive CLI reorganization that @standage did in #785

Yup, thanks again Daniel!

  • note that others have already chosen smash as the import for sourmash shrug

@will-rowe already used that pun, but smash sounds good too =]
https://github.com/will-rowe/hulk#quick-start

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

No branches or pull requests

2 participants