Materials-Consortia / Materials-Consortia/optimade-python-tools
The `OptimadeClient` should have a persistent cache on disk
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 91
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
As discussed in #1154, it would be good if the OptimadeClient had a persistent cache it could use to avoid repeating queries, e.g.:
optimade-get --filter 'elements HAS "Ag" example.org should check the cache.json for keys ["structures"][filter][base_url] before making any new requests.
Caveats:
- The cache lookup should check for any
links->nextto indicate whether not all pages of the results were pulled. - The cache should have a timeout/lifetime; this could be dynamic based on a auxiliary query to the database sorted by
last_modified. - The cache location should be configurable
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the OptimadeClient and optimade-get entry points, then review the cache.json structure described in the issue and the discussion in #1154. Define how incomplete links->next results, cache lifetime, dynamic freshness, and configurable location should work; done means repeated queries reuse valid complete cached results without unnecessary requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, cli, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100