optimade

Isomorphic TypeScript / JavaScript client to aggregate all the official Optimade providers

https://github.com/tilde-lab/optimade-client

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary

Keywords

chemoinformatics materials materials-design materials-discoveries materials-discovery materials-genome materials-informatics materials-platform materials-science optimade optimade-api optimade-specification
Last synced: 6 months ago · JSON representation ·

Repository

Isomorphic TypeScript / JavaScript client to aggregate all the official Optimade providers

Basic Info
  • Host: GitHub
  • Owner: tilde-lab
  • License: mit
  • Language: TypeScript
  • Default Branch: master
  • Homepage: https://optimade.science
  • Size: 521 KB
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • Open Issues: 7
  • Releases: 1
Topics
chemoinformatics materials materials-design materials-discoveries materials-discovery materials-genome materials-informatics materials-platform materials-science optimade optimade-api optimade-specification
Created about 5 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog License Citation

README.md

Aggregating Optimade client for the online materials databases

NPM version NPM downloads GitHub issues DOI

Features

  • discovers all the official Optimade databases recursively
  • caches the discovered list (prefetched.json) for future and boosts the retrieval performance
  • queries them all, in the browser, at the server, everywhere
  • provides pagination, with the minimized number of pages

Install

sh npm i optimade --save

sh yarn add optimade

CDN: UNPKG | jsDelivr (available as window.optimade)

If you are not using ES6 or CDN, add to your HTML just before closing the body tag:

html <script src="/path/to/optimade/dist/index.js"></script> <!-- OR --> <script type="module" src="/path/to/optimade/dist/index.mjs"></script>

Usage

The code is generally isomorphic, however one should additionally take care of downloading the cache or setting the CORS policy for the browsers. Concerning the CORS, the Optimade class constructor accepts the corsProxyUrl parameter, pointing to a running cors-anywhere proxy instance. This will be valid until all the Optimade providers are supplying the header Access-Control-Allow-Origin $http_origin in their responses. For the server-side environment this is not required.

Discovery and querying

```ts const optimadeClient = new Optimade({ providersUrl: "https://providers.optimade.org/providers.json", });

console.log(optimadeClient.providers); // { [id: string]: Provider }[]

const providersMap = await optimadeClient.getProviders(); // { [id: string]: Provider }[]

const providerIds = Object.keys(providersMap); // string[]

const results = await optimadeClient.getStructuresAll({ providers: Provider[], filter: YOUROPTIMADEQUERY, }); // [StructuresResponse[], Provider][] ```

Importing depends on your environment. See also the examples folder. The .html examples are suited for the browser environment, the .js examples are suited for the server environment.

Pagination

```ts import prefetched from 'optimade/dist/prefetched.json';

const optimadeClient = new Optimade({ providersUrl: "https://providers.optimade.org/providers.json", });

optimadeClient.providers = prefetched.providers; optimadeClient.apis = prefetched.apis;

const results = await optimadeClient.getStructuresAll({ providers: Provider[], filter: YOUROPTIMADEQUERY, page: number, limit: number, offset: number, batch: true }); // [StructuresResponse[], Provider][] ```

See also the demo folder.

License

MIT © Pavel Malyshev and Alexander Volkov, Tilde Materials Informatics

Owner

  • Name: Tilde
  • Login: tilde-lab
  • Kind: organization
  • Email: support@tilde.pro
  • Location: The Internet

Tilde Materials Informatics Virtual Lab

Citation (CITATION.cff)

cff-version: 1.2.0
title: optimade-client
type: software
license: MIT
authors:
  - given-names: Pavel
    family-names: Malyshev
  - given-names: Alexander
    family-names: Volkov
  - given-names: Evgeny
    family-names: Blokhin
    orcid: 'https://orcid.org/0000-0002-5333-3947'
doi: 10.5281/zenodo.7693400
url: 'https://github.com/tilde-lab/optimade-client'
repository-artifact: 'https://www.npmjs.com/package/optimade'
keywords:
  - chemoinformatics
  - materials science
  - materials informatics
  - materials platform
  - materials design
  - materials genome
  - optimade

GitHub Events

Total
Last Year

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 90
  • Total Committers: 5
  • Avg Commits per committer: 18.0
  • Development Distribution Score (DDS): 0.433
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Valexr v****r@g****m 51
Evgeny Blokhin eb@t****o 30
Pavel Malyshev p****v@d****m 4
PaulMaly p****l@m****u 4
PaulMaly p****s@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 12
  • Total pull requests: 12
  • Average time to close issues: 3 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 3
  • Total pull request authors: 4
  • Average comments per issue: 0.92
  • Average comments per pull request: 1.58
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • blokhin (10)
  • merkys (1)
  • Valexr (1)
Pull Request Authors
  • Valexr (7)
  • PaulMaly (2)
  • dependabot[bot] (2)
  • lgtm-com[bot] (1)
Top Labels
Issue Labels
help wanted (7) enhancement (4) bug (1)
Pull Request Labels
dependencies (2)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 119 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 3
  • Total versions: 15
  • Total maintainers: 2
npmjs.org: optimade

Aggregating Optimade client for the online materials databases

  • Versions: 15
  • Dependent Packages: 1
  • Dependent Repositories: 3
  • Downloads: 119 Last month
Rankings
Dependent repos count: 6.3%
Downloads: 10.6%
Stargazers count: 11.5%
Forks count: 11.6%
Average: 12.2%
Dependent packages count: 20.9%
Maintainers (2)
Last synced: 7 months ago

Dependencies

package-lock.json npm
  • 554 dependencies
package.json npm
  • @rollup/plugin-json ^4.1.0 development
  • @types/eslint ^8.4.2 development
  • @types/jest ^26.0.15 development
  • @typescript-eslint/eslint-plugin ^5.25.0 development
  • @typescript-eslint/parser ^5.25.0 development
  • eslint ^8.16.0 development
  • jest ^26.6.0 development
  • rollup ^2.47.0 development
  • rollup-plugin-typescript2 ^0.28.0 development
  • ts-jest ^26.4.1 development
  • typescript ^4.0.3 development
  • isomorphic-unfetch ^3.1.0
  • node-abort-controller ^3.0.1