mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-26 07:38:18 +01:00
Compare commits
No commits in common. "c9c277f8dfcf87bfe83dc7b5e54ef1ba6fa72fa7" and "1008acf35e2753d9194755dd186c5428a0c520e6" have entirely different histories.
c9c277f8df
...
1008acf35e
@ -9,10 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fixing invalid multi-value separators like `|` and `|||` is no longer class-
|
||||
ified as "unsafe" as I have yet to see a case where this was intentional
|
||||
|
||||
### Added
|
||||
- Configurable directory for AGROVOC requests cache (to allow running the web
|
||||
version from Google App Engine where we can only write to /tmp)
|
||||
|
||||
## [0.4.6] - 2021-03-11
|
||||
### Added
|
||||
- Validation of dcterms.license field against SPDX license identifiers
|
||||
|
@ -17,7 +17,7 @@ def parse_args(argv):
|
||||
parser.add_argument(
|
||||
"--agrovoc-fields",
|
||||
"-a",
|
||||
help="Comma-separated list of fields to validate against AGROVOC, for example: dcterms.subject,cg.coverage.country",
|
||||
help="Comma-separated list of fields to validate against AGROVOC, for example: dc.subject,cg.coverage.country",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--experimental-checks",
|
||||
@ -48,7 +48,7 @@ def parse_args(argv):
|
||||
parser.add_argument(
|
||||
"--exclude-fields",
|
||||
"-x",
|
||||
help="Comma-separated list of fields to skip, for example: dc.contributor.author,dcterms.bibliographicCitation",
|
||||
help="Comma-separated list of fields to skip, for example: dc.contributor.author,dc.identifier.citation",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import os
|
||||
import re
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
@ -243,11 +242,7 @@ def agrovoc(field, field_name):
|
||||
|
||||
# enable transparent request cache with thirty days expiry
|
||||
expire_after = timedelta(days=30)
|
||||
# Allow overriding the location of the requests cache, just in case we are
|
||||
# running in an environment where we can't write to the current working di-
|
||||
# rectory (for example from csv-metadata-quality-web).
|
||||
REQUESTS_CACHE_DIR = os.environ.get("REQUESTS_CACHE_DIR", ".")
|
||||
requests_cache.install_cache(f"{REQUESTS_CACHE_DIR}/agrovoc-response-cache", expire_after=expire_after)
|
||||
requests_cache.install_cache("agrovoc-response-cache", expire_after=expire_after)
|
||||
|
||||
# prune old cache entries
|
||||
requests_cache.core.remove_expired_responses()
|
||||
|
Loading…
Reference in New Issue
Block a user