-
Notifications
You must be signed in to change notification settings - Fork 0
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
Oai organization #2
Conversation
no more typos!
method to display query data in request xml
…hat gets displayed data and validation for metadata formats
oaipmh/templates/macros.html
Outdated
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.
Maybe rename this macros.xml?
if from_str: | ||
try: | ||
if not re.fullmatch(DATE_REGEX, from_str): | ||
raise ValueError |
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.
This is redundant since strptime will throw a ValueError
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.
strptime is a little too permissive and accepts things like 3-2-2024 which the specification says must be 03-02-2024
oaipmh/requests/routes.py
Outdated
#TODO duplicate params dont create errors, technically not to spec | ||
params: Dict[str, str] = request.args.to_dict() if request.method == 'GET' else request.form.to_dict() | ||
|
||
response, code, headers=verb_sorter(params) |
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.
Could the verb_sorter function be removed and the match statement moved here?
oaipmh/requests/data_queries.py
Outdated
|
||
return "<a>b</a>", 200, {} | ||
|
||
def list_records(params: Dict[str, str]) -> Response: |
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.
list_records and list_identifiers may be unnecessary extra level of function calls.
#TODO | ||
return "<a>b</a>", 200, {} | ||
|
||
def list_metadata_formats(params: Dict[str, str]) -> Response: |
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.
I could see this expected params processing split out to a function.
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.
Some minor comments. Overall looks good.
general file system layout, started to create separate paths for different verbs and errors