Topic
- Scientific/Engineering :: Physics
Intended Audience
- Science/Research
Programming Language
- C
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
Operating System
- Unix
- MacOS
- Microsoft :: Windows
Development Status
- 5 - Production/Stable
Python bindings for C library for finding and handling crystal symmetries
Installation
The package is developed on GitHub. You can get the source for the released versions from the repository.
Note that the Python bindings will link to the system/environment
installed Spglib (loaded from LD_LIBRARY_PATH or DYLD_LIBRARY_PATH),
and it will default to a bundled version otherwise. To always use the
system version of Spglib (e.g. in a lua-module environment) delete the
bundled libraries libsymspg.so* in the python Spglib installation
directory.
Using package distribution service
The easiest way to install python-spglib is to use the pypi package, for which numpy is required to be installed before the installation. A command to install spglib is:
$ pip install spglib
Conda is another choice:
$ conda install -c conda-forge spglib
These packages are made by Pawel T. Jochym.
Building from source
To build from source, make sure you have installed the build requirements
in pyproject.toml. Then simply run the following in the root directory.
$ python -m build
$ pip install .
To include testing or documentation environments, simply include the relevant extras
$ pip install .[test]
Running tests
After installing the project with appropriate extras (testing), either from
package manager or from source, simply run pytest in the current directory
to test the python bindings
$ pytest