{"id":20749719,"url":"https://github.com/tilde-lab/optimade-client","last_synced_at":"2025-04-28T12:51:22.345Z","repository":{"id":36992432,"uuid":"317343954","full_name":"tilde-lab/optimade-client","owner":"tilde-lab","description":"Isomorphic TypeScript / JavaScript client to aggregate all the official Optimade providers","archived":false,"fork":false,"pushed_at":"2023-07-19T00:34:30.000Z","size":533,"stargazers_count":5,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T04:23:41.833Z","etag":null,"topics":["chemoinformatics","materials","materials-design","materials-discoveries","materials-discovery","materials-genome","materials-informatics","materials-platform","materials-science","optimade","optimade-api","optimade-specification"],"latest_commit_sha":null,"homepage":"https://optimade.science","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tilde-lab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-30T20:56:29.000Z","updated_at":"2023-03-02T20:16:11.000Z","dependencies_parsed_at":"2024-11-17T23:00:41.362Z","dependency_job_id":null,"html_url":"https://github.com/tilde-lab/optimade-client","commit_stats":{"total_commits":90,"total_committers":5,"mean_commits":18.0,"dds":"0.43333333333333335","last_synced_commit":"5ac657d6b62f1c28b4aca3443707bb3cbbe8e461"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Foptimade-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Foptimade-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Foptimade-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilde-lab%2Foptimade-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tilde-lab","download_url":"https://codeload.github.com/tilde-lab/optimade-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251318122,"owners_count":21570289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chemoinformatics","materials","materials-design","materials-discoveries","materials-discovery","materials-genome","materials-informatics","materials-platform","materials-science","optimade","optimade-api","optimade-specification"],"created_at":"2024-11-17T08:24:16.777Z","updated_at":"2025-04-28T12:51:22.275Z","avatar_url":"https://github.com/tilde-lab.png","language":"TypeScript","readme":"# Aggregating Optimade client for the online materials databases\n\n[![NPM version](https://img.shields.io/npm/v/optimade.svg?style=flat)](https://www.npmjs.com/package/optimade)\n[![NPM downloads](https://img.shields.io/npm/dm/optimade.svg?style=flat)](https://www.npmjs.com/package/optimade)\n[![GitHub issues](https://img.shields.io/github/issues/tilde-lab/optimade-client?style=flat)](https://github.com/tilde-lab/optimade-client/issues)\n[![DOI](https://zenodo.org/badge/317343954.svg)](https://doi.org/10.5281/zenodo.7693400)\n\n## Features\n\n- discovers all the [official Optimade databases](https://providers.optimade.org) recursively\n- caches the discovered list (`prefetched.json`) for future and boosts the retrieval performance\n- queries them all, in the browser, at the server, everywhere\n- provides pagination, with the minimized number of pages\n\n## Install\n\n```sh\nnpm i optimade --save\n```\n\n```sh\nyarn add optimade\n```\n\nCDN: [UNPKG](https://unpkg.com/optimade/) |\n[jsDelivr](https://cdn.jsdelivr.net/npm/optimade/) (available as\n`window.optimade`)\n\nIf you are **not** using ES6 or CDN, add to your HTML just before closing the\n`body` tag:\n\n```html\n\u003cscript src=\"/path/to/optimade/dist/index.js\"\u003e\u003c/script\u003e\n\u003c!-- OR --\u003e\n\u003cscript type=\"module\" src=\"/path/to/optimade/dist/index.mjs\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nThe code is generally isomorphic, however one should additionally take care of\ndownloading the cache or setting the CORS policy for the browsers. Concerning\nthe CORS, the `Optimade` class constructor accepts the `corsProxyUrl` parameter,\npointing to a running `cors-anywhere` proxy instance. This will be valid\nuntil all the Optimade providers are supplying the header\n`Access-Control-Allow-Origin $http_origin` in their responses. For the\nserver-side environment this is not required.\n\n### Discovery and querying\n\n```ts\nconst optimadeClient = new Optimade({\n  providersUrl: \"https://providers.optimade.org/providers.json\",\n});\n\nconsole.log(optimadeClient.providers); // { [id: string]: Provider }[]\n\nconst providersMap = await optimadeClient.getProviders(); // { [id: string]: Provider }[]\n\nconst providerIds = Object.keys(providersMap); // string[]\n\nconst results = await optimadeClient.getStructuresAll({\n  providers: Provider[],\n  filter: YOUR_OPTIMADE_QUERY,\n}); // [StructuresResponse[], Provider][]\n```\n\nImporting depends on your environment. See also the `examples` folder. The\n`.html` examples are suited for the browser environment, the `.js` examples are\nsuited for the server environment.\n\n### Pagination\n\n```ts\nimport prefetched from 'optimade/dist/prefetched.json';\n\nconst optimadeClient = new Optimade({\n  providersUrl: \"https://providers.optimade.org/providers.json\",\n});\n\noptimadeClient.providers = prefetched.providers;\noptimadeClient.apis = prefetched.apis;\n\nconst results = await optimadeClient.getStructuresAll({\n  providers: Provider[],\n  filter: YOUR_OPTIMADE_QUERY,\n  page: number,\n  limit: number,\n  offset: number,\n  batch: true\n}); // [StructuresResponse[], Provider][]\n```\n\nSee also the `demo` folder.\n\n## License\n\nMIT \u0026copy; [Pavel Malyshev](https://github.com/PaulMaly) and [Alexander Volkov](https://github.com/valexr), Tilde Materials Informatics\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilde-lab%2Foptimade-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftilde-lab%2Foptimade-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilde-lab%2Foptimade-client/lists"}