-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor url code to better align with SEC API #36
Refactor url code to better align with SEC API #36
Conversation
Unfortunately this didn't work for me, the tool still behaves as if there was no quoting: edgar-tool text_search '"Tsunami Hazards"' makes requests to: |
@GalenReich Ahh my bad. I just ran through it with a debugger and figured it out in 549273e In order to make the debugger easy to use I had to rename Those changes will fix the issue for now. Users will need to wrap their already quoted phrase in another single quote, like in your example (
We can't because of an issue related to how For example, if I call the CLI without using the single quote then double quote pattern, edgar-tool text_search "John Doe" Pharmaceuticals Chemicals Then Lines 73 to 77 in 20c5d58
Which is then joined into the single string EDGAR/edgar_tool/text_search.py Lines 216 to 217 in 20c5d58
We can fix this so that the code understands that a string with a space character, like |
The desired behaviour is that a search for At the moment there is some double escaping going on and (in Powershell) the space is doubly escaped, but the quotes are missed: You've given me some ideas about solving this at the join - I'll push a commit or two in a sec |
I think that solves it - the machinery was already mostly working because of the urlencode here: EDGAR/edgar_tool/text_search.py Line 249 in 20c5d58
Those changes implement your suggestion of wrapping space-containing keywords in quotes, which also solves the escaping problem. Thanks for pointing out how Let me know what you think! |
@GalenReich haha man, it's your repo! If you think the PR is good to go then merge away 😎 I'll take a closer look at your commits tomorrow - but I trust ya! Im embarrassed that I didn't actually solve the issue and encoded the URL twice. I code like sh*t without TDD. It's my kryptonite. |
Converted to a draft while I flesh out the URL generation code. Will wrap this up in the coming days. |
4f412fb
to
164bbb2
Compare
4063931
to
e30880b
Compare
a25da2e
to
4d4c1ba
Compare
Hey @jordan-gillard I finally managed to close pr/40 - once again really sorry about the delay! Can this be closed as a duplicate now? |
@GalenReich I'll give everything a deeper look later and get back to ya! |
Closing. I'll get caught up with recent work and plan the next contribution :) |
This PR updates the examples in the repository's README.md file to wrap exact phrase searches in single quotes. This provides a cross-platform way to search for exact phrases on both Unix and Windows-based machines.
Resolves: #24