materials.catalog
MaterialCatalog — read-only view into one catalog within the MaterialRegistry.
Provides discovery and search UX for a specific manufacturer catalog.
Kramer Harrison, 2025
Classes
|
Read-only view into one glass manufacturer catalog. |
- class MaterialCatalog(catalog: str)[source]
Read-only view into one glass manufacturer catalog.
Usage:
MaterialCatalog.groups() # ['3d', 'glass', 'main', 'organic', 'other'] MaterialCatalog.available() # glass manufacturers only MaterialCatalog("schott").list() # glass names in catalog MaterialCatalog("schott").search("bk7") # substring search MaterialCatalog("schott").get("N-BK7") # instantiate material
- Parameters:
catalog – Glass manufacturer catalog name (e.g.
"schott","ohara").
- classmethod available() list[str][source]
Return sorted list of glass manufacturer catalog names.
The list is derived directly from the subdirectory names under the built-in
data-nk/glass/directory, which is the authoritative source of manufacturer catalogs. To list species in non-glass groups uselist_catalogs()directly withgroup='main','organic', or'other'.
- get(name: str, match_policy: MatchPolicy = MatchPolicy.WARN) object[source]
Instantiate a
Materialfrom this catalog.- Parameters:
name – Exact (or close) material name.
match_policy – Controls fuzzy-match behavior.
- Returns:
A
Materialinstance.
- classmethod groups() list[str][source]
Return sorted list of all group names in the database.
Groups reflect the top-level organisation of the refractiveindex.info database:
'glass'(manufacturer catalogs),'main'(elements and compounds),'organic'(organic species),'other'(miscellaneous), and'3d'(metamaterials/plasmonics).Non-glass groups are not exposed through
MaterialCatalog; uselist_catalogs()with agroupargument to enumerate them.
- search(query: str, n: int | None = None) list[str][source]
Return material names whose name contains
query(case-insensitive).- Parameters:
query – Substring to search for within glass names.
n – Maximum number of results to return.
Nonereturns all matches.
- Returns:
Sorted list of matching material names.