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

urllib.parse to handle user filter #3

Open
simroux opened this issue Dec 31, 2024 · 0 comments
Open

urllib.parse to handle user filter #3

simroux opened this issue Dec 31, 2024 · 0 comments

Comments

@simroux
Copy link

simroux commented Dec 31, 2024

I think it may be worth using urllib.parse to handle the filters that users can enter as arguments, in case these include spaces or other special characters (which I did by mistake :-D ). This could look something like:

import urllib.parse
...
if filter != "":
       filter = urllib.parse.quote_plus(filter)
url = f"{api_client.base_url}/nmdcschema/{collection_name}?filter={filter}&page_size={max_page_size}&projection={fields}"
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

1 participant