{"library":"spglib","title":"Spglib","type":"library","description":"Spglib is a C library for finding and handling crystal symmetries, exposed as a Python module. It is widely used in materials science and solid-state physics for tasks such as space group determination, primitive cell reduction, and irreducible k-point generation. The current stable version is 2.7.0, with regular updates and maintenance.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install spglib"],"cli":null},"imports":["import spglib","spglib.get_spacegroup(cell, symprec=1e-5)","spglib.get_symmetry_dataset(cell, symprec=1e-5)"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://spglib.readthedocs.io/","github":"https://github.com/spglib/spglib","docs":"https://spglib.readthedocs.io/","changelog":"https://spglib.readthedocs.io/en/latest/releases.html","pypi":"https://pypi.org/project/spglib/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import spglib\nimport numpy as np\n\n# Define a simple cubic cell\n# Lattice vectors as rows of a 3x3 matrix\nlattice = np.array([[1.0, 0.0, 0.0],\n                    [0.0, 1.0, 0.0],\n                    [0.0, 0.0, 1.0]])\n\n# Fractional coordinates of atoms\npositions = np.array([[0.0, 0.0, 0.0]])\n\n# Integer atom types (e.g., atomic number, or arbitrary unique integers)\nnumbers = [1]\n\n# Combine into a cell tuple: (lattice, positions, numbers)\ncell = (lattice, positions, numbers)\n\n# Determine the space group using a symmetry precision\nspacegroup_data = spglib.get_spacegroup(cell, symprec=1e-5)\nprint(f\"Spacegroup: {spacegroup_data}\")\n\n# Get a full dataset of symmetry information\ndataset = spglib.get_symmetry_dataset(cell, symprec=1e-5)\nprint(f\"Spacegroup number: {dataset['number']}\")\nprint(f\"International short symbol: {dataset['international_short']}\")","lang":"python","description":"This example demonstrates how to define a simple cubic unit cell and use `spglib.get_spacegroup` to identify its space group symmetry, as well as `spglib.get_symmetry_dataset` for more detailed information. Note the specific input format for the cell and the use of `symprec`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"2.7.0","pypi_latest":"2.7.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":50,"avg_install_s":3.8,"avg_import_s":0.41,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"spglib","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"spglib","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.8,"import_time_s":0.28,"mem_mb":10.2,"disk_size":"92M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"spglib","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"spglib","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.6,"import_time_s":0.44,"mem_mb":11.3,"disk_size":"99M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"spglib","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"spglib","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.5,"import_time_s":0.69,"mem_mb":14,"disk_size":"87M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"spglib","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"spglib","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.4,"import_time_s":0.33,"mem_mb":8.2,"disk_size":"86M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"spglib","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"spglib","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.6,"import_time_s":0.31,"mem_mb":10,"disk_size":"102M"}]}}