-
Notifications
You must be signed in to change notification settings - Fork 25
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
entrez module added #63
Conversation
candis/app/server/api/data.py
Outdated
@@ -231,3 +232,13 @@ def delete(): | |||
|
|||
return json_, code | |||
|
|||
@app.route(CONFIG.App.Routes.API.Data.DOWNLOAD, methods = ['POST']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POST is added as of now- will change it to GET, when download through GEO will be possible.
requirements.txt
Outdated
@@ -95,5 +95,6 @@ urllib3==1.22 | |||
wcwidth==0.1.7 | |||
webencodings==0.5.1 | |||
Werkzeug==0.14.1 | |||
wget==3.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests
module have only a monkey patch for FTP servers, so had to resort to wget
which works well, and also displays a progress bar while downloading a file from the server (in this case GEO FTP server).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using inbuilt ftplib instead now.
candis/data/entrez/api.py
Outdated
self.name = assign_if_none(name, Client.NAME) | ||
|
||
# TODO: Should we cache databases? | ||
self.name = assign_if_none(name, 'candis')#Client.NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was with the Client parameter? @achillesrasquinha - #17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced 'candis', with 'CONFIG.NAME'.
candis/data/entrez/api.py
Outdated
else: | ||
raise TypeError('params should be a dictionary') | ||
|
||
|
||
# TODO: Should we cache each response? | ||
class API(object): | ||
# TODO: Assign CONFIG.NAME to NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add in config file, 'NAME' field, and then use it here ? @achillesrasquinha
candis/data/entrez/api.py
Outdated
|
||
return params | ||
|
||
def _create_redis_instance(self): | ||
# TODO: to parse .env files, use python-dotenv or envparse? and for defaults use config file? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which one do you suggest @achillesrasquinha
Add GEO Entrez esearch basic setup
@achillesrasquinha Merging this now ✨, have added the TODO list in the issue #53 which I will solve in the follow-up PRs. |
Explanation About What Code Achieves:
Solves 1,2,3 and 4 task of #53
@achillesrasquinha GIF for you to review, how this API going to work
![searchanddownload](https://user-images.githubusercontent.com/20624380/40897338-2d00b87c-67d8-11e8-9c86-d62acb8b1b99.gif)
TO DO: