Registry / data / mendeleev

mendeleev

JSON →
library1.1.0pypypi✓ verified 85d ago

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.

pip install mendeleev
INSTALL
IMPORT
SIG · MENDELEEV
M
mendeleev
datapythonv1.1.0
Install
12.5s avg
Import
3269ms
Disk
222MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 3.373s · 217.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 12.5s · import 3.165s · 208MB
222MB installed
● package 222MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Element objects directly (e.g., Si, Fe)
from mendeleev import Si, Fe
Allows direct access to common elements as objects.
element function
from mendeleev import element
from mendeleev.mendeleev import element
The `element` function is exposed directly at the top-level package, not within a submodule like `mendeleev.mendeleev`.
fetch_table function
from mendeleev.fetch import fetch_table
Used for retrieving bulk data as pandas DataFrames from the internal database.

This quickstart demonstrates how to import the `element` function and retrieve an element's properties such as name, atomic number, atomic weight, electronic configuration, and electronegativity.

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')}")
Debug
Known issues
breakingVersion 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.
fix
Ensure your environment's `numpy` version is 2.0 or higher. You may need to update `numpy` explicitly: `pip install 'numpy>=2.0'`.
affects: >=1.1.0
gotchaMendeleev 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.
fix
Always use `from mendeleev.fetch import fetch_table` and other `fetch_` functions for bulk data access to ensure compatibility and stability.
affects: All versions
gotchaPrior 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.
fix
Upgrade `mendeleev` to version 0.17.0 or higher to benefit from improved compatibility with `pandas` and `sqlalchemy`.
affects: <0.17.0
gotchaIn 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.
fix
Ensure you are using `mendeleev` v0.16.2 or newer to avoid potential import-related issues.
affects: <0.16.2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mendeleev'
The 'mendeleev' library is not installed in your Python environment or the environment where you are running your code.
fix
Install the library using pip: `pip install mendeleev`
AttributeError: module 'time' has no attribute 'clock'
This error typically occurs due to an incompatibility between an older version of `sqlalchemy` (a dependency of `mendeleev`) and the Python version being used, where `time.clock()` was removed in Python 3.8 and later.
fix
Upgrade `sqlalchemy` to a compatible version or ensure you are using a `mendeleev` version that has resolved this dependency issue. A common fix is `pip install --upgrade sqlalchemy` or `pip install mendeleev --upgrade` to get the latest compatible dependencies.
KeyError: 'XX'
This error occurs when trying to access an element using a symbol that does not exist in the mendeleev database, or attempting to access a property that is not defined for an element. For example, if 'XX' is not a valid element symbol or if a property like `element('Fe').non_existent_property` is requested.
fix
Ensure the element symbol is correct (e.g., 'Fe' for Iron, not 'fe') and that the property you are trying to access is a valid attribute of the `Element` object (e.g., `Fe.atomic_number`, `Fe.name`). Refer to the `mendeleev` documentation for available elements and their properties.
Installing mendeleev uninstalls existing packages (e.g., NumPy)
This is a dependency conflict where `mendeleev`'s required packages (or their specific versions) clash with versions of packages already installed in your environment, leading pip to try and 'resolve' the conflict by uninstalling existing packages.
fix
It is highly recommended to install `mendeleev` in a dedicated virtual environment (e.g., using `venv` or `conda`) to avoid conflicts with other projects' dependencies. Alternatively, you can try to identify the conflicting dependency and manually upgrade or downgrade it to a version compatible with both `mendeleev` and your other libraries.
Upgrade
Version history
1.1.0latest on PyPI · released Jun 10, 2025
Audit
Dependencies
coloramarequiredRequired for command-line interface formatting.
deprecatedrequiredUsed for marking deprecated functions.
numpyrequiredFundamental package for numerical computing, used internally for data handling.
pandasrequiredUsed for tabular data manipulation, especially with bulk data access functions.
pydanticrequiredUsed for data validation and settings management.
pyfigletrequiredUsed for ASCII art in CLI output.
pygmentsrequiredUsed for syntax highlighting in CLI output.
sqlalchemyrequiredORM used for interacting with the internal SQLite database.
Agent activity
3 hits · last 30 days
node
2
Meta
1
Resources
mendeleev — pip install mendeleev · libregistry