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.0rc1.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.0rc1-cp314-cp314-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ x86-64

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

File metadata

  • Download URL: pyobjcryst-2026.1.0rc1.tar.gz
  • Upload date:
  • Size: 162.1 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.0rc1.tar.gz
Algorithm Hash digest
SHA256 c8ad7ea303eda53c82d4558d6c70e99b8d6cab1ee8cb466506c1cbf50b6ead40
MD5 7786841793bdcb513a907b9cdaaefadd
BLAKE2b-256 7ee5e9229c6d358038faf9841afd107812de963f923ed28e38fe651cbd772805

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e309897552a39d69ce572d2f69d8b8a8bb6be27347b746970a0504f326de256f
MD5 686fd8aec242a77a38bca84e1ed0d688
BLAKE2b-256 8c931b3225fe70134a452147a9c50b12f4b2da8cbb780be11499c0f2f3749e15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 deabec4ec5c1dba03c81a9147fe2dbe6f99cdf13376b0526b9f1091b83bd3283
MD5 ae4141658e51c41b20530f1092b5ecfb
BLAKE2b-256 a40e2d781017f7cec42347dd38c5aec0a376afb018a058221c11abea5f8ed871

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a5755ca7e59349d88d001f328f12bf9694ae732a2bad4b28aeff8729091621f2
MD5 f003649e33377bdc8f9f8c44be7992a7
BLAKE2b-256 26b12aee612ec876b0c0878261189441c8638538b5c8f034fc6e0ebd1409c727

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6a8674e1afd2d7c25bb0786fc9ca124ac2052526ee8e72159ac1828030478ad
MD5 aadd4aba6a6641a72a31205d24dbd6fd
BLAKE2b-256 258b120cbe069af61203528a7d764e74f4fa816f74a2524a7992f0863e22ff46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bbfb0958643157891404917105a5b6563268cc5556430cc454c7db62a5d1cea9
MD5 fb4374c506b84e6a60bbac3ca72725d9
BLAKE2b-256 e23b809b42bc08345e73d7e0ab7a4e903232029c273a28aa8e2b81f0020ac1df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a73eaa5eb5b0f0360120c2d7cbbc61a86d00013b459bf361ec1c15d3722bed79
MD5 95e8a234aed46174e842c2c80fbd702b
BLAKE2b-256 3bb327bd585f9020f2d98bd4c34847d13e2eac9484de548aaa59d3e2f41f40e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e7cc67eff7b7ccd597b56f03832ce77bcfe26a802ccda553f1d95b071063e7b6
MD5 6409a471003a9d81a3290063e7951b8d
BLAKE2b-256 128858b6482d08ccf7c484b6f25d0b82de49b91c348fa4885a04ea66daed8d38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 738edd6ace8a4e51e831a82e90272ba37a465891d75ecfbc8fc7c7bc06425d22
MD5 30ec43d4db7c08b6b8dd516cfa5621d5
BLAKE2b-256 88ddd9d097b23600f2eeed29f4dea9e16a66319ef19aa54156c4f374be9e2201

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 835777f77c3b31bb0dac55f509597586b380ccc05f6f2fa94d8681ca6f237876
MD5 0e8704e0ca86c2393f29ac39672ee3b3
BLAKE2b-256 86c16f280613194a46f21828905f163c7b63c5de1f9fca6d1f909e72038d1917

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 33fb89594ef13f319ef75e5580bcb487496ef32af69b788086b4e539a8c0845c
MD5 a7dcafcc4580e47733aba7e3631c04f8
BLAKE2b-256 3ed66bb1f52096e9e3af7d716e1d86b8eb4b21994a8adc9223268e29b6ad34d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 8537ad828227b5b1495e2ca237a0fed732611c5a827ad6c77e44f70604e2cc5c
MD5 7bec8ef3278dba1f2a6ec92177305946
BLAKE2b-256 d9261ce3737febe1e6e2d1058e55e96cd784d0bf414cad7b37b17be9b4024089

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyobjcryst-2026.1.0rc1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd0a02553089a83963f6f96ac714d40631a7eaee5ed089a1e9211f3cf97b27a1
MD5 29eef6078ea0bca53b4ca702f8494146
BLAKE2b-256 a76a7d3b05cf4c8a1a1d5fc88ecb6b12727246ee11fbdaafab83b4cc0e04dc6b

See more details on using hashes here.

Release history Release notifications | RSS feed

2026.1.0

13 files

This release

2026.1.0rc1 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