We are using the FileStation API and this package is really helpful but it is a bit annoying to use for the asyn requests in a fully automatic mode. Usually our workflow is the following:
Call a *_start function (for example FileStation.search_start)
The output is a string containing the task_id
Parse the string to get the task_id
Call a get_* function with the task_id to get the results
The parsing could be easily prevented if the output of the "start" method was the task_id directly. If it seems ok with you, I am willing to do a PR where depending on an option in FileStation (or in the methods) the output is directly the task_id. This option would be set by default to False to keep backward compatibility.
This would lead to the following code (not sure about the parameter name):
fs = FileStation(..., dict_output=False) # default
res = fs.start_search(...)
# res is a str with the current message "You can now ..."
fs = FileStation(..., dict_output=True)
res = fs.start_search(...)
# res is of the form {"message": "'You can now ...", "task_id": 35000}
If that sounds ok with you, I can submit a PR soon.
We are using the FileStation API and this package is really helpful but it is a bit annoying to use for the asyn requests in a fully automatic mode. Usually our workflow is the following:
The parsing could be easily prevented if the output of the "start" method was the task_id directly. If it seems ok with you, I am willing to do a PR where depending on an option in FileStation (or in the methods) the output is directly the task_id. This option would be set by default to False to keep backward compatibility.
This would lead to the following code (not sure about the parameter name):
If that sounds ok with you, I can submit a PR soon.