Registry / data / lobsterpy

lobsterpy

JSON →
library0.6.1pypypiunverified

Lobsterpy is a Python package designed for automatic bonding analysis derived from LOBSTER calculations, which themselves process VASP output. It helps researchers analyze chemical bonding in materials efficiently. The current version is 0.6.0, and the project is under active development with irregular but consistent releases.

pip install lobsterpy
INSTALL
IMPORT
SIG · LOBSTERPY
L
lobsterpy
datapythonv0.6.1
Install
29.6s avg
Import
Disk
608MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.8 · 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.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 29.6s · import 0.000s · 569MB
608MB installed
● package 608MB
Code
Verified usage

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

LobsterpyAnalysis
from lobsterpy import LobsterpyAnalysis
from lobsterpy import LobsterpyAnalysis

This example demonstrates how to initialize `LobsterpyAnalysis` with a LOBSTER/VASP calculation directory and extract basic bonding and population data. Ensure the `path_to_lobster_calc` variable points to a directory containing all necessary LOBSTER and VASP output files.

from pathlib import Path from lobsterpy.cohp.analyze import LobsterpyAnalysis # NOTE: Replace with the actual path to your LOBSTER/VASP calculation directory. # This directory should contain files like COHPCAR.lobster, vasprun.xml, POSCAR etc. # For a runnable example, you would need to set up such a directory locally. path_to_lobster_calc = Path('/path/to/your/lobster_calculation_output') # Create an instance of LobsterpyAnalysis try: analyzer = LobsterpyAnalysis( path_to_lobster_calc=path_to_lobster_calc, gaussian_smearing_width=0.05, spin_type='none' # or 'up', 'down' for spin-polarized calculations ) # Access bonding analysis results bond_data = analyzer.bond_analysis print("Bond Analysis:\n", bond_data) # You can also get population data population_data = analyzer.get_population_data() print("Population Data:\n", population_data) except FileNotFoundError as e: print(f"Error: Calculation path not found or missing files. {e}") print("Please ensure 'path_to_lobster_calc' points to a valid LOBSTER/VASP calculation directory.") except Exception as e: print(f"An error occurred during analysis: {e}")
lobsterpy --version
Debug
Known issues
breakingMajor refactoring in versions >=0.5.0 moved key classes and changed method signatures. `LobsterpyAnalysis` and `LobsterpyData` are now in `lobsterpy.cohp.analyze` and `lobsterpy.cohp.data` respectively.
fix
Update your imports from `from lobsterpy.analysis import ...` to `from lobsterpy.cohp.analyze import ...` and `from lobsterpy.data import ...` to `from lobsterpy.cohp.data import ...`. Review the changelog for specific method signature changes.
affects: >=0.5.0
gotchaThe `LobsterpyAnalysis` constructor requires a complete LOBSTER/VASP calculation directory. Missing essential files (e.g., `COHPCAR.lobster`, `vasprun.xml`, `POSCAR`) will lead to `FileNotFoundError` or parsing errors.
fix
Verify that `path_to_lobster_calc` is a valid path and contains all required output files from a successful LOBSTER calculation (e.g., COHPCAR.lobster, ICOHPCAR.lobster, DOSCAR.lobster, vasprun.xml, POSCAR, KPOINTS, POTCAR, INCAR).
affects: All
deprecatedDirect plotting functions within `LobsterpyAnalysis` have been largely deprecated or moved. For plotting, use the dedicated `lobsterpy.plotting` module introduced in version 0.6.0.
fix
Instead of calling methods like `analyzer.plot_cohps()`, import plotting functions from `from lobsterpy.plotting import plotting` (or similar) and pass the analysis data to them.
affects: >=0.6.0
Upgrade
Version history
0.6.1latest on PyPI · released May 6, 2026
Audit
Dependencies
pymatgenrequiredCore dependency for parsing VASP and LOBSTER calculation outputs.
Agent activity
18 hits · last 30 days
node
14
Resources
lobsterpy — pip install lobsterpy · libregistry