bellingcat / EDGAR

Tool for the retrieval of corporate and financial data from the SEC
https://colab.research.google.com/github/bellingcat/EDGAR/blob/main/notebook/Bellingcat_EDGAR_Tool.ipynb
GNU General Public License v3.0
95 stars 12 forks source link

Escape characters not well documented #24

Open apassy opened 2 months ago

apassy commented 2 months ago

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"

GalenReich commented 1 month ago

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!