Skip to main content

Python interface to RefractiveIndex database

Tests

Python interface to the refractiveindex.info database. The database (~15 MB) is bundled. Install with

pip install refractiveindex

Usage

import refractiveindex as ri

# load a material by shelf, book and page
SiO = ri.RefractiveIndexMaterial(shelf='main', book='SiO', page='Hass')
# or from the address-bar URL of a refractiveindex.info page
SiO2 = ri.RefractiveIndexMaterial.from_url(
    'https://refractiveindex.info/?shelf=main&book=SiO2&page=Malitson'
)

# find names, best match first
ri.search('SiO2')
#  0  main/SiO2/Malitson                       Malitson 1965: n 0.21–6.7 µm [Fused silica]
#  1  main/SiO2/Nyakuchena                     Nyakuchena et al. 2023: n 1.10–1.65 µm [Fused silica]
#  ...
# only pages with k data that covers 1550 nm
ri.search('SiO2', quantity='k', wavelength=1550)
SiO2 = ri.search('SiO2')[0].material()

# wavelength in nm by default
SiO.get_refractive_index(600)        # 1.9655

# unit= accepts 'nm', 'um', 'mm', 'm', 'A', 'cm-1', 'THz', 'eV'; arrays work too
SiO.get_extinction_coefficient([0.6, 0.7], unit='um')  # array([0.001, 0.00075])

# permittivity for exp(-iωt) (default) or exp(+iωt) time dependence
SiO.get_epsilon(600)                        # (3.8633+0.0039j)
SiO.get_epsilon(600, exp_type='exp(+iwt)')  # (3.8633-0.0039j)

# valid wavelength range
SiO.get_wl_range(unit='nm')          # (240.0, 14000.0)

Documentation

See DOCUMENTATION.md for unit conversions, separate n and k ranges, values outside the range, and other copies of the database.

Citation

M. N. Polyanskiy, "Refractiveindex.info database of optical constants," Scientific Data 11, 94 (2024). https://doi.org/10.1038/s41597-023-02898-2

Please also state the database version for reproducibility. The database is CC0.

print(ri.DATABASE_VERSION)  
print(ri.DATABASE_COMMIT)

See also

Metadata

Release files for refractiveindex 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for refractiveindex 1.3.0
File Size Uploaded Provenance Actions
refractiveindex-1.3.0.tar.gz 12.3 MB With provenance Details for refractiveindex-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for refractiveindex 1.3.0
File Interpreter ABI Platform Actions
refractiveindex-1.3.0-py3-none-any.whl Python 3 none any Details for refractiveindex-1.3.0-py3-none-any.whl

Total release size: 27.3 MB

Release files / refractiveindex-1.3.0.tar.gz

Download URL refractiveindex-1.3.0.tar.gz
Size 12.3 MB
Tags Source
SHA-256 checksum
How to use checksums
859d0048ec749014bf80e11414a5c127b0a5d960ee4dfc3621ab0a384f37f7b8
BLAKE2b-256 checksum
How to use checksums
11b7d0f997767003297fb6b311a115975d86887b4768344437faab40e33d78de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / refractiveindex-1.3.0-py3-none-any.whl

Download URL refractiveindex-1.3.0-py3-none-any.whl
Size 15.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c4cf449d7ea1552029e199959eebe492c544bb3cf8642ce88b5f4b07eacf1f8e
BLAKE2b-256 checksum
How to use checksums
1f033737f7928c353fe5709b1d02a96cc2ae22f913fb11d56df4a79dd513cb39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for refractiveindex 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for refractiveindex-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page