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

Add simple command-line interface #42

Closed
merwok opened this issue Nov 15, 2019 · 3 comments
Closed

Add simple command-line interface #42

merwok opened this issue Nov 15, 2019 · 3 comments

Comments

@merwok
Copy link
Contributor

merwok commented Nov 15, 2019

Hello! Thanks for this lib, it’s really useful to generate unique IDs painlessly.

Often I want to generate a bunch of values, for example to define object IDs in test fixtures. It’s easy enough to open a Python shell to do that, but would be even easier with a command-line interface 🙂

Simplest version:

# add shortuuid/__main__.py
from .main import uuid

if __name__ == "__main__":
    print(uuid())
$ python -m shortuuid
QG6wVwX8X4kqy829JE9zLT

Featureful version: add params to control length [*] and number of IDs to generate.

*: I’m not sure if this should use ShortUUID.random or uuid+truncate

@skorokithakis
Copy link
Owner

Hmm, that's a good idea. I would not be opposed to it, would you care to open a PR?

@merwok
Copy link
Contributor Author

merwok commented Nov 15, 2019

Yes! Simple or full version?

@skorokithakis
Copy link
Owner

Probably the simple version first, and we can take it from there!

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

No branches or pull requests

2 participants