Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bpo-44431: Added command line functionality to UUID module. #26751

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

Closed
wants to merge 3 commits into from
Closed

bpo-44431: Added command line functionality to UUID module. #26751

wants to merge 3 commits into from

Conversation

ephenix
Copy link

@ephenix ephenix commented Jun 16, 2021

I often need to generate a GUID quickly and from the command line.

Rather than install additional utilities to accomplish this on various platforms, it would be amazing if Python had this functionality built-in.

I specifically avoided using any additional modules such as argparse to handle the few arguments that uuid3 and uuid5 have to keep the functionality lightweight, instead relying on sys.argv to capture the additional arguments from the CLI.

Looking forward to hearing others' thoughts on this functionality.

https://bugs.python.org/issue44431

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@ephenix

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Copy link
Contributor

@nanjekyejoannah nanjekyejoannah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix failing tests and add a news entry given this is an enhancement.

@@ -0,0 +1 @@
UUID module now supports being called from command line. ex > python -m uuid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need an example in a news entry. I would do way with ex > python -m uuid .


if __name__ == '__main__':
"""
Enables uuid to be called from the command line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can move this logic into a helper method so that we just call the method here? Most libraries seem to follow this e.g Lib/timeit.py

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jul 18, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants