Skip to main content

PyPI Forge PythonVersion PR

CI Codecov Black Tracking

Python bindings to ObjCryst++, the Object-Oriented Crystallographic Library.

For more information about the pyobjcryst library, please consult our online documentation.

pyobjcryst is an open-source software package originally developed as a part of the DiffPy-CMI complex modeling initiative which originated in the DANSE project at Columbia University. It was further developed at Brookhaven National Laboratory, and Columbia University and the European Synchrotron Radiation Source (ESRF) and is now maintained at University of California, Santa Barbara and ESRF. The pyobjcryst sources are hosted at https://github.com/diffpy/pyobjcryst.

Citation

If you use diffpy.srfit in a scientific publication, we would like you to cite this package as

P. Juhás, C. L. Farrow, X. Yang, K. R. Knox and S. J. L. Billinge, Complex modeling: a strategy and software program for combining multiple information sources to solve ill posed structure and nanostructure inverse problems, Acta Crystallogr. A 71, 562-568 (2015).

and

V. Favre-Nicolin and R. Cerný, FOX, ‘free objects for crystallography’: a modular approach to ab initio structure determination from powder diffraction, J. Appl. Cryst. 35, 734-743 (2002)

The second paper describes the c++ crystallographic objects in ObjCryst++ that are wrapped by pyobjcryst

Installation

The latest release of pyobjcryst runs in python versions 3.12, 3.13 and 3.14. You may specify an earlier release if you need it to run in an earlier version of Python.

The preferred method is to use Miniconda Python and install from the “conda-forge” channel of Conda packages.

To permanently add “conda-forge” to the conda channels (recommended), run the following in a terminal.

conda config --add channels conda-forge

We want to install our packages in a suitable conda environment. The following creates and activates a new environment named pyobjcryst-env

conda create -n pyobjcryst-env pyobjcryst
conda activate pyobjcryst-env

To confirm that the installation was successful, type

python -c "import pyobjcryst; print(pyobjcryst.__version__)"

The output should print the latest version displayed on the badges above.

pyobjcryst is also included in the diffpy.cmi collection of packages for structure analysis and so can be installed by

conda install -c conda-forge diffpy.cmi

and following the instructions in the diffpy.cmi documentation to install packs containing pyobjcryst and its libraries.

Optional graphical dependencies for jupyter notebooks

Some of the classes can produce graphical outputs, which can be displayed in a jupyter notebook:

  • a Crystal structure can be displayed in 3D: this requires the py3dmol and ipywidgets modules. See the notebook docs/examples/cystal_3d_widget.ipynb

  • a PowderPattern can be displayed (and live-updated) if matplotlib and ipympl are installed. See the notebook docs/examples/structure-solution-powder-cimetidine.ipynb

Getting Started

You may consult our online documentation for tutorials and API references.

Alternative methods of installation

These approaches are not recommended but reproduced here for advanced users. You can use pip to download and install the latest release from Python Package Index.

Pyobjcryst can be installed from pip. We recommend installing the dependencies that can be found in requirements/conda.txt from conda-forge, e.g.,

conda create -n pyobjcryst-env python=3.14
conda activate pyobjcryst-env
conda install -c conda-forge numpy libobjcryst libboost-devel libboost-python packaging ipywidgets matplotlib-base ipympl py3dmol
pip install pyobjcryst

If you prefer to install from sources, after installing the dependencies, obtain the source archive from GitHub. Once installed, cd into your pyobjcryst directory and run the following

pip install .

An alternative way of installing pyobjcryst is to use the SCons tool, which can speed up the process by compiling C++ files in several parallel jobs (-j4):

conda install scons
conda install --file requirements/conda.txt
scons -j4 dev

See scons -h for description of build targets and options.

Alternatively, on Ubuntu Linux the required software can be installed using

sudo apt-get install \
     python-setuptools python-numpy scons \
     build-essential python-dev libboost-all-dev

If this doesn’t work, please see the requirements/conda.txt file for the latest list of requirements.

The libobjcryst library can also be installed as per the instructions at https://github.com/diffpy/libobjcryst. Make sure other required software are also in place and then run from the pyobjcryst directory

pip install .

You may need to use sudo with system Python so the process is allowed to copy files to system directories, unless you are installing into a conda environment. If administrator (root) access is not available, see the usage information from python setup.py install –help for options to install to a user-writable location.

Testing your installation

The installation integrity can be verified by executing the included tests with

First install test dependencies then type pytest:

conda install --file requirements/tests.txt
pytest

Support and Contribute

If you see a bug or want to request a feature, please report it as an issue and/or submit a fix as a PR.

Feel free to fork the project and contribute. To install pyobjcryst in a development mode, with its sources being directly used by Python rather than copied to a package directory, use the following in the root directory

pip install -e .

To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit hooks.

  1. Install pre-commit in your working environment by running conda install pre-commit.

  2. Initialize pre-commit (one time only) pre-commit install.

Thereafter your code will be linted by black and isort and checked against flake8 before you can commit. If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before trying to commit again.

When developing it is preferable to compile the C++ files with SCons using the build=debug option, which compiles the extension module with debug information and C-assertions checks

scons -j4 build=debug dev

Improvements and fixes are always appreciated.

Before contributing, please read our Code of Conduct.

Contact

For more information on pyobjcryst please visit the project web-page or email Simon Billinge at sbillinge@ucsb.edu.

You can also contact Vincent Favre-Nicolin (favre@esrf.fr) if you are using pyobjcryst outside diffpy, e.g. to display structures in a notebook, refine powder patterns or solve structures using the global optimisation algorithms, etc..

Acknowledgements

This package bundles the following IUCr data files for bona fide research use:

pyobjcryst is built and maintained with scikit-package.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyobjcryst-2026.1.0.tar.gz (162.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyobjcryst-2026.1.0-cp314-cp314-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.14Windows x86-64

pyobjcryst-2026.1.0-cp314-cp314-manylinux_2_39_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

pyobjcryst-2026.1.0-cp314-cp314-macosx_11_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

pyobjcryst-2026.1.0-cp314-cp314-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyobjcryst-2026.1.0-cp313-cp313-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.13Windows x86-64

pyobjcryst-2026.1.0-cp313-cp313-manylinux_2_39_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

pyobjcryst-2026.1.0-cp313-cp313-macosx_11_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyobjcryst-2026.1.0-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyobjcryst-2026.1.0-cp312-cp312-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.12Windows x86-64

pyobjcryst-2026.1.0-cp312-cp312-manylinux_2_39_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

pyobjcryst-2026.1.0-cp312-cp312-macosx_11_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyobjcryst-2026.1.0-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file pyobjcryst-2026.1.0.tar.gz.

File metadata

  • Download URL: pyobjcryst-2026.1.0.tar.gz
  • Upload date:
  • Size: 162.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for pyobjcryst-2026.1.0.tar.gz
Algorithm Hash digest
SHA256 0ca642db5d534bf24efce9a9f6d7c2e45026f5b0691fecb7fe8e69118535786e
MD5 b60dfae6c18676b31d6778dfb2dff05d
BLAKE2b-256 edd1e599c132ccfa37eaea9dd1f6e68cd53f271898baf44618575fe4045ecd35

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 75b4d7ae4168c6e5737fda7cae1cd12bf528655a275f0cb3b52a2b5920a291b1
MD5 ffd3566ee4802f18bf36011950a4197f
BLAKE2b-256 f2b241e1fd813aa730741249a20b319f8576e88aa6a663373d31c73a8f32a0fc

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 eeb32702cd8f431d871e17ab55bdb71d8bb111c3318df24030085c0645659126
MD5 1fbe5012e56c06b649dea14f884b5e81
BLAKE2b-256 9ef5e98566cf5d73382c280c0b2555fbc9d98d4dbe6279fd0cd3ce634bcbf6cb

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp314-cp314-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 46696a8f3337b23b527f45d229bcd3f34604ad1698fd518ad5ad3d0dda96d96a
MD5 cf49a23330f2f1cb43bd2db39a54ac46
BLAKE2b-256 07b806fe8cf1efbb48af80df428871a468e9f686247fffe3880bf0ea9312f94d

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 782f992230819f8f99301bc8a35c3dfe75ab793d2870a194728e54623c0cb1fd
MD5 4782db1ec484dc492f2fc5c11791de3a
BLAKE2b-256 b9dc37e33b76d009b43e10a8fbc5aa2d668d90577bea20991a61662426596d8b

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a7c700a131fa11164f97397dc680424cdbbd597cf560b1a73ac5ccf608edeafa
MD5 3ead1469fbb9ed158a57ddc58b17ce3e
BLAKE2b-256 ec6a30f9b593a0282e1e7fe2347a2a431aae876a31f2b12401a239d87f6cf71a

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 dbb6819d63e62304ea007f5ac28fa054870e600f378f386906fbad74eba668bb
MD5 265172c29ec51e12b303192ade3c04df
BLAKE2b-256 fb9847f9ea7885953d418cb523857a5b5708f8302b39b2bd198b5094304b943d

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp313-cp313-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c7d2e1400e3b6dd310896c681724f6fda605365b4331d46dd5a6999161c4ad73
MD5 5453a16452cbb36bc81311baea319688
BLAKE2b-256 9651a9d366c0b512ef9d3a8626b9c7b1f8707881ca5cad619c97ce8be263a4ce

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6461edecfb39668f945af2fd73aa9214b80f1906b77726ff38f0a32014c6695e
MD5 5de3f317a9db153fef4aebd027afd15f
BLAKE2b-256 6884f3da25f34d7a6521b5726fb1ca64dcd91570af69ac907fa70c27b9f3923b

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a77b6a60c74d4f2e2344c42af51a48d396bb58a501ba0851fb261406a4b2d575
MD5 2a48d940eef69de453158e53ff23a16a
BLAKE2b-256 423436c231ae44f3219ca8d52c8876ad6652c637d6d2f57e1dc6c4953def8f68

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 b9a98076f2ca2cd5bb744f5d9187735f09064366d8b2cef5c4c93ed147f6777a
MD5 68eee0b258b7fc146494eba801042f52
BLAKE2b-256 0347ceb7ebd5ffcef40fa8250e667e9fbb93ed9cd2b955beeeae8ad97ec02a70

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 21e36452d400e8d2c1d837b5943b6f99cc0aac5051fdb0494410444cd3e6efa6
MD5 aefaf73443c62bd1e5ff3c4f46fa66fb
BLAKE2b-256 19d26d2b876df72979c1ede396fb71ab963e94739f80af83152382b31b7331f7

See more details on using hashes here.

File details

Details for the file pyobjcryst-2026.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4f3717e342a429a3fa9ff525a8688f63478cce74b48bb1c93e17f2b614e5736
MD5 319def58cf4a74fb98bd09b0c5c3694f
BLAKE2b-256 9e98646b2b2e82c7317be0efdad52dba130ceb72fac78bd6b50d077f6611da32

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2026.1.0 This release

13 files

2025.1.0

13 files

2.2.6

1 file

2.2.5.post1

2 files

2.2.5

2 files

2.2.0

1 file

2.1.0.post2

1 file

2.1.0

1 file

2.0.2

1 file

2.0.1

1 file

2.0

1 file

1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page