← 返回首页
bpo-44431: Added command line functionality to UUID module. by ephenix · Pull Request #26751 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

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

Closed
ephenix wants to merge 3 commits into
python:mainfrom
ephenix:uuid-command-line-functionality
Closed

bpo-44431: Added command line functionality to UUID module.#26751
ephenix wants to merge 3 commits into
python:mainfrom
ephenix:uuid-command-line-functionality

Conversation

ephenix commented Jun 16, 2021
edited by bedevere-bot
Loading

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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!

nanjekyejoannah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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

Comment thread Lib/uuid.py

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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

Copy link
Copy Markdown

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

github-actions Bot added the stale Stale PR or inactive for long period of time. label Jul 18, 2021
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.