EDGAR icon indicating copy to clipboard operation
EDGAR copied to clipboard

Escape characters not well documented

Open apassy opened this issue 1 year ago • 2 comments

edgar-tool text_search "BF Borgers"

Results in: https://efts.sec.gov/LATEST/search-index?q=%5CBF+Borgers%5C&dateRange=custom&startdt=2019-05-05&enddt=2024-05-03&page=1

Note that %5C is , not "

Py 12, windows 10, powershell 7.42.

This is a Doc issue. For Powershell it should be: edgar-tool text_search "BF Borgers"

apassy avatar May 03 '24 16:05 apassy

Thanks for opening this issue! It took a few moments to parse thanks to the markdown interpreter, but I think it boils down to the escape character being backslash (\) in Linux/Mac, backtick (`) in Windows Powershell, and caret (^) in WIndows Command Prompt

There are a few ways this could be handled:

  1. Documentation - simply changing the documentation to make this subtlety clear.
  2. Parsing - work out a better way of parsing the command-line search arguments. I don't think this is possible though as the characters are handled by the shell.
  3. Interactive session - we could make it so that when a user runs text_search without arguments they would be interactively prompted for their search (which wouldn't have to deal with escape characters) - a bit more clunky perhaps, but might help with the usability when it comes to the escape characters!

GalenReich avatar May 08 '24 10:05 GalenReich

@GalenReich @apassy

I believe the solution is to wrap the exact search term, including the double quotes ", in single quotes ', as in:

edgar-tool text_search '"John Doe"' Pharmaceuticals Chemicals

I will open a PR in a second that updates the README.

jordan-gillard avatar Jul 07 '24 19:07 jordan-gillard

This has been fixed by #40, new release to PyPi soon

GalenReich avatar Oct 28 '24 10:10 GalenReich