skillfed

spglib

This is the spglib module.

spglib v2.7.0 1.4M downloads/30d#3,960 on PyPI372
Permissive license BSD-3-Clause Active released

What it is and what it does

spglib is a Python interface to a C library for crystallographic symmetry analysis. It identifies space groups, finds symmetry operations, and handles crystal structure symmetries—core tasks in materials science, solid-state physics, and computational chemistry. The package wraps a compiled C backend and depends on numpy, importlib-resources, and typing-extensions.

It is intended for researchers and engineers working with crystal structures who need to programmatically detect and manipulate symmetries. The bindings can use either a bundled Spglib library or link to a system-installed version via LD_LIBRARY_PATH or DYLD_LIBRARY_PATH, offering flexibility in environments with pre-existing Spglib installations.

Use it for:

  • Identify the space group and symmetry operations of a crystal structure from lattice and atomic positions
  • Reduce a crystal structure to its primitive cell using symmetry information
  • Generate equivalent atomic positions under space group symmetry operations
  • Validate crystal structure symmetry in materials discovery or high-throughput screening workflows
  • Integrate symmetry analysis into computational materials science pipelines

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

spglib provides Python bindings to a C library for identifying and manipulating crystal symmetries and space groups in crystallographic structures.

Yes, if you work with crystallographic data. spglib is actively maintained, carries no known vulnerabilities, supports modern Python versions (3.9–3.14), and is widely used in materials science. Medium install friction is typical for compiled bindings and poses no barrier on standard platforms. The BSD-3-Clause license is permissive.

Install

spglib on PyPI

pip

pip install spglib

uv

uv add spglib

poetry

poetry add spglib

Installing spglib

Before you install

Medium install friction due to compiled C bindings, but well-supported across Python 3.9–3.14 and major platforms (macOS, Windows, Linux). Active maintenance with recent commits and no known vulnerabilities. Requires numpy pre-installation.

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution required.

Quickstart

pip install spglib
import spglib
spglib.get_spacegroup((lattice, positions, numbers))

numpy must be installed before spglib; C bindings require compatible platform wheels or a system Spglib library.

Verify before relying

  • Exact API surface and available symmetry operations beyond space group detection
  • Performance characteristics for large crystal structures
  • Whether bundled vs. system Spglib library choice affects behavior or performance

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies 3 — numpy, importlib-resources, typing-extensions
Maintenance actively maintained — 228 days since the last release
Last repo commit
First released
Downloads 1,396,683/month — #3,960 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: spglib-2.7.0-cp310-cp310-macosx_11_0_arm64.whl; spglib-2.7.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; spglib-2.7.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; spglib-2.7.0-cp310-cp310-win_amd64.whl; spglib-2.7.0-cp311-cp311-macosx_11_0_arm64.whl; spglib-2.7.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; spglib-2.7.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; spglib-2.7.0-cp311-cp311-win_amd64.whl; spglib-2.7.0-cp311-cp311-win_arm64.whl; spglib-2.7.0-cp312-cp312-macosx_11_0_arm64.whl; spglib-2.7.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; spglib-2.7.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; spglib-2.7.0-cp312-cp312-win_amd64.whl; spglib-2.7.0-cp312-cp312-win_arm64.whl; spglib-2.7.0-cp313-cp313-macosx_11_0_arm64.whl; spglib-2.7.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; spglib-2.7.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; spglib-2.7.0-cp313-cp313-win_amd64.whl; spglib-2.7.0-cp313-cp313-win_arm64.whl; spglib-2.7.0-cp314-cp314-macosx_11_0_arm64.whl

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: CProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Physics

Tags

crystal symmetry detectionspace group identificationcrystallographic symmetry analysiscrystal structure symmetryspacegroup findersymmetry operations crystalcrystallography symmetry tools
crystallographymaterials-sciencesymmetry-analysis

More Physics packages