Skip to content
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

Merged
merged 23 commits into from
Jun 12, 2018
Merged

entrez module added #63

merged 23 commits into from
Jun 12, 2018

Conversation

rupav
Copy link
Collaborator

@rupav rupav commented May 28, 2018

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

TO DO:

  • remove print statements, switch to logging instead, making it less verbose.

@@ -231,3 +232,13 @@ def delete():

return json_, code

@app.route(CONFIG.App.Routes.API.Data.DOWNLOAD, methods = ['POST'])
Copy link
Collaborator Author

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
Copy link
Collaborator Author

@rupav rupav May 31, 2018

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).

Copy link
Collaborator Author

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.

self.name = assign_if_none(name, Client.NAME)

# TODO: Should we cache databases?
self.name = assign_if_none(name, 'candis')#Client.NAME)
Copy link
Collaborator Author

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

Copy link
Collaborator Author

@rupav rupav Jun 13, 2018

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'.

else:
raise TypeError('params should be a dictionary')


# TODO: Should we cache each response?
class API(object):
# TODO: Assign CONFIG.NAME to NAME
Copy link
Collaborator Author

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


return params

def _create_redis_instance(self):
# TODO: to parse .env files, use python-dotenv or envparse? and for defaults use config file?
Copy link
Collaborator Author

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

@rupav
Copy link
Collaborator Author

rupav commented Jun 12, 2018

@achillesrasquinha Merging this now ✨, have added the TODO list in the issue #53 which I will solve in the follow-up PRs.

@rupav rupav merged commit 67e9513 into HelikarLab:develop Jun 12, 2018
@rupav rupav changed the title entrez esearch added entrez module added Jun 12, 2018
@rupav rupav added this to Done in GSoC '18 (Rupav Jain) Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant