Aller au contenu

omnilab/materials-project Référence de l’API

Étage
Fournisseur · Omnilab
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnilab/materials-project:1.x-dev

Lue dans les fichiers PHP du paquet au commit 758f53a3013c : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnilab\MaterialsProject

  • MaterialsProjectSource class

    The Materials Project (Lawrence Berkeley National Laboratory), computed properties of inorganic materials, through its API (api.materialsproject.org, an account's key required): a material by its id ("mp-149") - its formula, chemical system, elements, sites, density, volume, symmetry (crystal system, space group, point group), energies per atom (total, formation, above the hull), stability, band gap, metal or not, magnetism, elastic moduli, whether theoretical, the ids it has in other databases (ICSD...) -; the materials of a formula or a chemical system.

    5 methods · 3 constants

  • MaterialsProjectSourceFactory class

    The Materials Project: computed properties of inorganic materials by their id, the materials of a formula or a chemical system - an account's API key required (free, on registering).

    3 options

Omnilab\MaterialsProject

MaterialsProjectSource class

final class MaterialsProjectSource extends HttpSource MaterialsProjectSource.php:33

The Materials Project (Lawrence Berkeley National Laboratory), computed properties of inorganic materials, through its API (api.materialsproject.org, an account's key required): a material by its id ("mp-149") - its formula, chemical system, elements, sites, density, volume, symmetry (crystal system, space group, point group), energies per atom (total, formation, above the hull), stability, band gap, metal or not, magnetism, elastic moduli, whether theoretical, the ids it has in other databases (ICSD...) -; the materials of a formula or a chemical system.

One call an entity or a page (its summary endpoint, the fields asked). Not tested live: no key was available (README).

const BASE_URI = 'https://api.materialsproject.org/'
const MAX_LIMIT = 1000

The most materials a page holds (the API's limit is 1000).

const FIELDS = ['material_id', 'formula_pretty', 'chemsys', 'elements', 'nelements', 'nsites', 'density', 'density_atomic', 'volume', 'symmetry', 'energy_per_atom', 'format…

The summary fields asked: what an entity holds.

MaterialsProjectSource::__construct()

public function __construct(HttpClientInterface $http, readonly ?string $apiKey, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)

MaterialsProjectSource::getName()

public function getName(): string

MaterialsProjectSource::capabilities()

public function capabilities(): array

MaterialsProjectSource::entity()

public function entity(Identifier|string $id): ?Entity

A material by its id ("mp-149", "materialsproject:mp-149", its page); another base's identifier is refused before any call; null when the Materials Project has none.

public function search(Query $query): Page

The materials of a formula ("Fe2O3", "SiO2", an anonymous "AB2", a wildcard "Fe*O3") or of a chemical system ("Fe-O": a dash), in the API's order; a domain other than chemistry answers nothing. An entity of a page holds what entity() gives.

MaterialsProjectSourceFactory class

final class MaterialsProjectSourceFactory extends SourceFactory MaterialsProjectSourceFactory.php:21

The Materials Project: computed properties of inorganic materials by their id, the materials of a formula or a chemical system - an account's API key required (free, on registering).

options: api_key: '%env(MP_API_KEY)%' # the key of a Materials Project account: every call needs one mailto: 'support@glitchr.io' # in the User-Agent throttle: 0 # seconds between two calls: no rate published base_uri: 'https://api.materialsproject.org/'

Options

OptionDefault
api_keynull
throttle0.0
base_uriMaterialsProjectSource::BASE_URI