Mendeleev
Mendeleev is a Python library that provides a convenient API for accessing various properties of elements, ions, and isotopes from the periodic table. It includes functionalities for data manipulation, integration with pandas for bulk data access, and visualization capabilities using libraries like Bokeh and Plotly. The library is actively maintained, with its current version being 1.1.0.
Warnings
- breaking Version 1.1.0 introduces a bump in the `numpy` dependency to `^2.0`. Projects relying on an older `numpy` version (e.g., `numpy<2.0`) will experience breakage when upgrading `mendeleev` to 1.1.0.
- gotcha Mendeleev ships with its own SQLite database. While direct interaction is possible, the recommended way to access data in bulk is through functions in the `mendeleev.fetch` module (e.g., `fetch_table`). Bypassing these functions might lead to issues if the internal database schema changes in future versions.
- gotcha Prior to v0.17.0, there were known compatibility issues with the `fetch_table` function when used with certain major versions of `pandas` and `sqlalchemy`. Although resolved in v0.17.0, users on older `mendeleev` versions might still encounter these problems.
- gotcha In earlier versions (specifically around v0.16.1 and v0.16.2), there were reported issues with `ImportErrors` not being raised correctly or general import errors. While fixed, this suggests a historical fragility in the import mechanism that users on very old versions might encounter.
Install
-
pip install mendeleev
Imports
- Element objects directly (e.g., Si, Fe)
from mendeleev import Si, Fe
- element function
from mendeleev import element
- fetch_table function
from mendeleev.fetch import fetch_table
Quickstart
from mendeleev import element
# Get an element by symbol
si = element("Si")
# Access its properties
print(f"Element: {si.name} ({si.symbol})")
print(f"Atomic Number: {si.atomic_number}")
print(f"Atomic Weight: {si.atomic_weight}")
print(f"Electronic Configuration: {si.econf}")
print(f"Pauling Electronegativity: {si.electronegativity(scale='pauling')}")