Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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 Columbia 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.11, 3.12 and 3.13. 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 or mamba and install from the “conda-forge” channel of Conda packages. mamba works in the same way as conda but has the advantage of being much faster when resolving dependencies during installation. It also uses by default the conda-forge repository, which is what almost all users would want.

To add “conda-forge” to the conda channels, 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.

To use mamba, replace conda with mamba in the commands 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

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. To install using pip into your pyobjcryst_env environment, type

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.0rc0.tar.gz (162.0 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.0rc0-cp314-cp314-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.14Windows x86-64

pyobjcryst-2026.1.0rc0-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.0rc0-cp314-cp314-macosx_11_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

pyobjcryst-2026.1.0rc0-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.0rc0-cp313-cp313-macosx_11_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

pyobjcryst-2026.1.0rc0-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.0rc0-cp312-cp312-macosx_11_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyobjcryst-2026.1.0rc0-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.0rc0.tar.gz.

File metadata

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

File hashes

Hashes for pyobjcryst-2026.1.0rc0.tar.gz
Algorithm Hash digest
SHA256 14b36d01fc1225fcb58d1900ffa99ede3bf9b88160748f3a735750b495e69155
MD5 9db44491ee50ae27e9ab743d3ded150c
BLAKE2b-256 bb4dd33f5ddd1660b912f36f6b073dd168b18b4a5af3b4a09f148dfed3d6fbff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 f0406d362eaede7e5ca30ade646105af317b04474190ad98e6d7b820b35ee267
MD5 be083717f413a8c0ebe747e5fb6dc804
BLAKE2b-256 b8291a91d34874fce708621ad8f7bea6640bbd8ed23181a46ea290dd87bd23b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 787254ab6044a40753be15c7379fb02c9cb80e56e5d5ff9550d740e1bf2b4515
MD5 603a69f045c1ed62ea6b31f146732a91
BLAKE2b-256 772a91215bf2fd5e1aa8a7e688d2ce346b2d081e01463f56006ab466f9cfb130

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1ffd624b4f58ed3a854e14f2b19cdc7555e1acd854ad5b8785a2930f76ecb5f9
MD5 74485849ce90eb56febfcf7cc62e62a4
BLAKE2b-256 80c55c61b2df68c4ebc8bab6f8ae64ba7d661e0ee0e204876d22e21ad9c06516

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf935612f94e2d4143b6f8e456901fe39ad48b8c41321819f1db7205849e8032
MD5 e727f24d6dbcb5514fe3f006c65dd2e8
BLAKE2b-256 b771514bd5c88a96d5ac158bc319f21e7814dcda2662aeafff4e7192c496d0d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8a3d554d406063ee2ca5dd18974ae1324e294af76a3e40d9661c55a10b222778
MD5 13122e422d29d404f8a4b33022694c06
BLAKE2b-256 821edebdd90bd396d4461bc7f042619aa5b01b58963fb11a8bf9c7e0838420cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 955f6e87e412167b54de73f17297d000a457308b52f44b6591829b743017abac
MD5 3a1a0776b9ca6eb12270c90dafe618a8
BLAKE2b-256 2c3e51bcbcbab948f43e4f561ce355c7c085b6b2ea8b771c2451740f52ac7e18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e00a968d1acad964aa93be91e24ec0d699f6dd42502047bfd52f82e4462252b8
MD5 3ee5414ae6578711cdd0fb9796529d19
BLAKE2b-256 726090f14663dd9c7ea315a1ed34657a7a4d39706f128cb905d7c75e368b2a4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 50c7553ae550e4920810da29a7f3d3b49b66f58b8fd7f884b782a54da1945888
MD5 466ce459e881ad2a82401a2df2358df5
BLAKE2b-256 a63c31e16c6bd745c908331341824ad6f4630ef7a750589e48a752f3fe7feb5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 aa69e5f77df74e3d73e7de4f0a9f50056a9a7678bdce660b40fd129e908cb2ee
MD5 e7ae39dc68ceca8ed138053683bfbf7a
BLAKE2b-256 14b4c849265310396e39c66274fc35b087f0fca79e3114170ea186b3c7e61044

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 672b7291ac3fc2101dc4be734df0f7b30c7aaef6a68eff4ff4f39ae1830cd863
MD5 20a7ea374eb78f8aee416a62dd49dd7e
BLAKE2b-256 b2ee357fc22afb1a8e188b17f7005f95bb1b6c6f699d9e6f305bedf00c168224

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 5a7abeba4fb233428a5c196d8df580272e5d3b01b78023d4e6a0dfd276e41955
MD5 823ede5036fd9480fbc47ad9af5690bf
BLAKE2b-256 fb477c4ccd9a70df6e9485be48c267546ba3596d920556e5d355633f0c7e06cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c150593cf4a6eefcbaba5f9813d1a072f5d658bd3dcda6e382ffbbaf040b31b
MD5 41d4b2606d193557b75522f4f770fa6d
BLAKE2b-256 75f274f0c3d54d49b8162ab74e67aa4e3e60bdb7789e5baa75d1bf63eabbcf6a

See more details on using hashes here.

Supported by

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