Skip to content

Add level flag when downloading bites#65

Merged
bbelderbos merged 3 commits intoPyBites-Open-Source:mainfrom
Pradhvan:Issue-64
Feb 10, 2025
Merged

Add level flag when downloading bites#65
bbelderbos merged 3 commits intoPyBites-Open-Source:mainfrom
Pradhvan:Issue-64

Conversation

@Pradhvan
Copy link
Contributor

@Pradhvan Pradhvan commented Feb 7, 2025

Adds level flag to download which level of bites is to be downloaded.

# Show all bites (original behavior)
$ eatlocal download

# Show only beginner bites
$ eatlocal download --level Beginner

# Show only intermediate bites
$ eatlocal download --level Intermediate

# Show only advanced bites
$ eatlocal download --level Advanced

Edge case that I can think of right now

  1. Level is not valid so added an exception for it
$ eatlocal download --level advanceInvalid level: advance.
Valid levels are: advanced, intro, intermediate, newbie, beginner.

@Pradhvan
Copy link
Contributor Author

Pradhvan commented Feb 7, 2025

@rhelmstedter @bbelderbos whenever you get time can you please look into this PR. Thank You 🐍

@rhelmstedter
Copy link
Collaborator

Nicely done.

My one suggestion would be to remove the Optional import. Since we are using python 3.12 we can use the | character. Your type hint can just be level: str | None. Or, if @bbelderbos prefers, we can go find the other | characters and use Optional everywhere.

@Pradhvan
Copy link
Contributor Author

Pradhvan commented Feb 7, 2025

This is the first time I am working with type hints so I am good with both the approaches you suggested @rhelmstedter

Let me wait for @bbelderbos 's suggestion post that I can make the update.

Let me also see if I can add a test for the same.

Copy link
Collaborator

@bbelderbos bbelderbos left a comment

Choose a reason for hiding this comment

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

Nice, I am happy with these changes. There are a few small things you could do to make it even better, do you want to make those changes? Thanks.

@Pradhvan
Copy link
Contributor Author

Nice, I am happy with these changes. There are a few small things you could do to make it even better, do you want to make those changes? Thanks.

Sure let me update the PR with the suggested changes. 😄

@Pradhvan Pradhvan requested a review from bbelderbos February 10, 2025 15:03
@Pradhvan
Copy link
Contributor Author

@bbelderbos updated necessary changes to the code. 🐍

@bbelderbos
Copy link
Collaborator

Perfect, thanks!

@bbelderbos bbelderbos merged commit f6803a7 into PyBites-Open-Source:main Feb 10, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants