-
Notifications
You must be signed in to change notification settings - Fork 8
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
Clean commit - added metadatat files to clean MAIN #27
Conversation
self.connect() | ||
|
||
def connect(self) -> str: | ||
""" Not needed as metadata services are REST service calls """ |
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.
[blackfmt] reported by reviewdog 🐶
""" Not needed as metadata services are REST service calls """ | |
"""Not needed as metadata services are REST service calls""" |
##################################################################### | ||
# Supporting Functions |
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.
[blackfmt] reported by reviewdog 🐶
##################################################################### | |
# Supporting Functions | |
##################################################################### | |
# Supporting Functions |
##################################################################### | ||
# Function to GET content from URL with retries |
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.
[blackfmt] reported by reviewdog 🐶
##################################################################### | |
# Function to GET content from URL with retries | |
##################################################################### | |
# Function to GET content from URL with retries |
##################################################################### | ||
# Function to GET content from URL with retries | ||
def getURL(self, url, headers="NONE"): | ||
|
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.
[blackfmt] reported by reviewdog 🐶
retries = Retry(total=6, | ||
backoff_factor=1, | ||
status_forcelist=[403, 404, 413, 429, 500, 502, 503, 504]) |
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.
[blackfmt] reported by reviewdog 🐶
retries = Retry(total=6, | |
backoff_factor=1, | |
status_forcelist=[403, 404, 413, 429, 500, 502, 503, 504]) | |
retries = Retry( | |
total=6, backoff_factor=1, status_forcelist=[403, 404, 413, 429, 500, 502, 503, 504] | |
) |
def list_datasets( | ||
self, | ||
limit: int = 10, | ||
offset: int = 0 | ||
) -> list: |
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.
[blackfmt] reported by reviewdog 🐶
def list_datasets( | |
self, | |
limit: int = 10, | |
offset: int = 0 | |
) -> list: | |
def list_datasets(self, limit: int = 10, offset: int = 0) -> list: |
""" | ||
self.host_api = "https://scicrunch.org/api/1/elastic/SPARC_Algolia_pr/_search" | ||
|
||
list_url = self.host_api + "?" + "from=" + str(offset) + "&size=" + str(limit) + "&key=" + self.scicrunch_api_key |
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.
[blackfmt] reported by reviewdog 🐶
list_url = self.host_api + "?" + "from=" + str(offset) + "&size=" + str(limit) + "&key=" + self.scicrunch_api_key | |
list_url = ( | |
self.host_api | |
+ "?" | |
+ "from=" | |
+ str(offset) | |
+ "&size=" | |
+ str(limit) | |
+ "&key=" | |
+ self.scicrunch_api_key | |
) |
list_results = self.getURL(list_url, headers=self.default_headers) | ||
return list_results | ||
|
||
|
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.
[blackfmt] reported by reviewdog 🐶
def search_datasets(self, query: str = '{"query": { "match_all": {}}}') -> list: | |
"""Gets datasets matching specified query. | |
def search_datasets( | ||
self, | ||
query: str = "{\"query\": { \"match_all\": {}}}" | ||
) -> list: | ||
"""Gets datasets matching specified query. | ||
|
||
This function provides |
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.
[blackfmt] reported by reviewdog 🐶
def search_datasets( | |
self, | |
query: str = "{\"query\": { \"match_all\": {}}}" | |
) -> list: | |
"""Gets datasets matching specified query. | |
This function provides | |
This function provides |
|
||
list_url = self.host_api + "?" + "key=" + self.scicrunch_api_key | ||
|
||
list_results = self.postURL(list_url, body = query, headers=self.default_headers) |
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.
[blackfmt] reported by reviewdog 🐶
list_results = self.postURL(list_url, body = query, headers=self.default_headers) | |
list_results = self.postURL(list_url, body=query, headers=self.default_headers) |
# Instructions for getting an API key can be found at: https://fdilab.gitbook.io/api-handbook/sparc-k-core-api-overview/getting-started-with-sparc-apis | ||
|
||
import json | ||
from sparc.client import SparcClient |
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.
[formatters] reported by reviewdog 🐶
from sparc.client import SparcClient | |
from sparc.client import SparcClient |
@@ -0,0 +1,281 @@ | |||
import logging |
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.
[formatters] reported by reviewdog 🐶
import logging |
@@ -0,0 +1,281 @@ | |||
import logging | |||
import json | |||
|
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.
[formatters] reported by reviewdog 🐶
import logging | |
from configparser import SectionProxy | |
from typing import List, Optional, Union | |
from configparser import SectionProxy | ||
from typing import List, Optional, Union |
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.
[formatters] reported by reviewdog 🐶
from configparser import SectionProxy | |
from typing import List, Optional, Union |
self.connect() | ||
|
||
def connect(self) -> str: | ||
""" Not needed as metadata services are REST service calls """ |
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.
[formatters] reported by reviewdog 🐶
""" Not needed as metadata services are REST service calls """ | |
"""Not needed as metadata services are REST service calls""" |
def list_datasets( | ||
self, | ||
limit: int = 10, | ||
offset: int = 0 | ||
) -> list: |
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.
[formatters] reported by reviewdog 🐶
def list_datasets( | |
self, | |
limit: int = 10, | |
offset: int = 0 | |
) -> list: | |
def list_datasets(self, limit: int = 10, offset: int = 0) -> list: |
""" | ||
self.host_api = "https://scicrunch.org/api/1/elastic/SPARC_Algolia_pr/_search" | ||
|
||
list_url = self.host_api + "?" + "from=" + str(offset) + "&size=" + str(limit) + "&key=" + self.scicrunch_api_key |
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.
[formatters] reported by reviewdog 🐶
list_url = self.host_api + "?" + "from=" + str(offset) + "&size=" + str(limit) + "&key=" + self.scicrunch_api_key | |
list_url = ( | |
self.host_api | |
+ "?" | |
+ "from=" | |
+ str(offset) | |
+ "&size=" | |
+ str(limit) | |
+ "&key=" | |
+ self.scicrunch_api_key | |
) |
list_results = self.getURL(list_url, headers=self.default_headers) | ||
return list_results | ||
|
||
|
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.
[formatters] reported by reviewdog 🐶
def search_datasets(self, query: str = '{"query": { "match_all": {}}}') -> list: | |
"""Gets datasets matching specified query. | |
def search_datasets( | ||
self, | ||
query: str = "{\"query\": { \"match_all\": {}}}" | ||
) -> list: | ||
"""Gets datasets matching specified query. | ||
|
||
This function provides |
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.
[formatters] reported by reviewdog 🐶
def search_datasets( | |
self, | |
query: str = "{\"query\": { \"match_all\": {}}}" | |
) -> list: | |
"""Gets datasets matching specified query. | |
This function provides | |
This function provides |
|
||
list_url = self.host_api + "?" + "key=" + self.scicrunch_api_key | ||
|
||
list_results = self.postURL(list_url, body = query, headers=self.default_headers) |
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.
[formatters] reported by reviewdog 🐶
list_results = self.postURL(list_url, body = query, headers=self.default_headers) | |
list_results = self.postURL(list_url, body=query, headers=self.default_headers) |
@athril The CI build is failing on a file we haven't touched and is not part of this pull request. |
New pull request with clean addition to latest MAIN