-
-
Notifications
You must be signed in to change notification settings - Fork 800
✨ Implement list parsing from string with separators #800
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
base: master
Are you sure you want to change the base?
✨ Implement list parsing from string with separators #800
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Hi, thanks for your PR! I'll put this in draft as long as the test suite is failing. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 💚
This comment was marked as outdated.
This comment was marked as outdated.
92a6d81 to
d5328fa
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
This would be great! Much more convenient to pass a large number of elements to an option 💯 |
|
I'd love to use this! |
|
@libklein would this work for Enum type choices too? |
|
@tiangolo Little loving nudge ☝️ 😅 |
|
@misse Yes, it is compatible with all of typer's (and click's) features. |
|
Hi @svlandeg, more than a year has passed since creating the PR. Are there any updates concerning the roadmap? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Hi @libklein, I have updated the PR to adhere to the new documentation format, and it is still awaiting further review by Tiangolo. It has been put on our internal review queue. I'd like everyone to refrain from adding additional pings, as that just creates a longer PR thread and generates a lot of noise in our notifications on our end. Instead, if you'd like this PR to be merged, please add an emoticon on the very first post ☝️, which gives us a good idea on how "popular" the idea/PR is. I do realise it can be a bit frustrating to have this PR sit here for so long. There's just a lot of working in maintaining several open-source repo's (Typer, FastAPI, SQLModel, ...) and we do our best to keep up. Thanks for your understanding! 🙏
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
📝 Docs previewLast commit 9c313dd at: https://de921145.typertiangolo.pages.dev Modified Pages |
Implements feature #554.
This merge request introduces the functionality to parse List[T] options from strings using a specified separator. An example of how this can be utilized is demonstrated below:
The implementation works by overwriting the
process_valuefunction of the click parser, doing string splitting before forwarding the result to click. This ensures full compatibility with the existing features of both Click and Typer. The feature does not allow whitespace only separators to avoid ambiguities.Feedback is much appreciated!
Open questions:
typer.Option, which delays error detection until the command execution. Should we consider moving this error handling to theOptionInfoconstructor to allow for earlier failure detection?ToDo: