Skip to main content

xtalforge

xtalforge (Python)

Python bindings for xtalforge, the pure Rust library for building, manipulating, analysing and exporting crystal structures. The same engine powers the Rust API, the CLI and the WebAssembly package.

Install

pip install xtalforge

The wheel is abi3 (CPython 3.9+) and ships NumPy arrays for positions, fractional positions, the cell matrix and atomic numbers.

Quick start

import xtalforge

structure = xtalforge.Structure.from_cif(cif_text)
print(structure.formula, structure.n_sites)
print(structure.positions)          # NumPy (n, 3), Angstrom
print(structure.cell)               # NumPy (3, 3), rows a, b, c

slab = structure.supercell(2, 2, 1).slab(0, 0, 1, layers=2, vacuum=10.0)
slab.write("slab.cif")

dataset = xtalforge.detect_symmetry(structure)
pattern = xtalforge.pxrd(structure)
print(dataset["hm_symbol"], pattern["points"][:3])

Structure also accepts the free-function wrappers: functions whose first argument is structure text accept a Structure handle and avoid reparsing. The 1.x text/dict API remains available; typed results (SymmetryDataset, PxrdPattern, PorosityReport, OptimizeResult) are dict-compatible.

Batch helpers

import xtalforge.batch

structures = xtalforge.batch.read(["a.cif", "b.cif"])
texts = [structure.to_json() for structure in structures]
datasets = xtalforge.batch.detect_symmetry(texts)
patterns = xtalforge.batch.pxrd(texts)

Results keep input order. See the object API guide for the full list of methods, arrays and batch helpers.

License

MIT OR Apache-2.0.

Metadata

Release files for xtalforge 1.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xtalforge 1.14.0
File Size Uploaded Provenance Actions
xtalforge-1.14.0.tar.gz 2.2 MB Without provenance Details for xtalforge-1.14.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for xtalforge 1.14.0
File Actions
xtalforge-1.14.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for xtalforge-1.14.0-cp39-abi3-win_amd64.whl
xtalforge-1.14.0-cp39-abi3-musllinux_1_1_x86_64.whl CPython 3.9 abi3 Linux musl 1.1+ x86-64 Details for xtalforge-1.14.0-cp39-abi3-musllinux_1_1_x86_64.whl
xtalforge-1.14.0-cp39-abi3-musllinux_1_1_aarch64.whl CPython 3.9 abi3 Linux musl 1.1+ ARM64 Details for xtalforge-1.14.0-cp39-abi3-musllinux_1_1_aarch64.whl
xtalforge-1.14.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for xtalforge-1.14.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
xtalforge-1.14.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for xtalforge-1.14.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
xtalforge-1.14.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for xtalforge-1.14.0-cp39-abi3-macosx_11_0_arm64.whl
xtalforge-1.14.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for xtalforge-1.14.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 39.2 MB

Release files / xtalforge-1.14.0.tar.gz

Download URL xtalforge-1.14.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
f5bf819232443a94eccb57e034ccc2d93f25d83d51f0c5432fa79435160c4c2b
BLAKE2b-256 checksum
How to use checksums
aa975f84716a786049cacc64966c6c92f579e90e85e15a2bbc50415f7483a64f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.14.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.14.0-cp39-abi3-win_amd64.whl
Size 5.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
39d1e089275f0d8b648720bda8cb8b1795e76a27e92577517cc610d41c7331a7
BLAKE2b-256 checksum
How to use checksums
a793c93887fa9a216fe6b7c094cdc099ecb2c0bc2b6a97eea9aa10cff15b0ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.14.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.14.0-cp39-abi3-musllinux_1_1_x86_64.whl
Size 5.7 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
937e902ca846035bba33e3071fb659037fc20dae2f4fc97f8427bf810d50852f
BLAKE2b-256 checksum
How to use checksums
83e9fb9239f99b3f8631fd0dbabaeac75857e3ac90cb66eeb401697ebe4929a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.14.0-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.14.0-cp39-abi3-musllinux_1_1_aarch64.whl
Size 5.2 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
160099450caf56d0e1d40c586d14bc7938889f23f12f2156dce221ff5909fccb
BLAKE2b-256 checksum
How to use checksums
186fb1bf0a648e3c8840fd55e1cf26adbe5950056b2db698cd66f64f1ed636de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.14.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.14.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 5.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
4b7e038aba748450593564336c7c89010336e65acec846976f5fd33d4d0afa12
BLAKE2b-256 checksum
How to use checksums
d4814e1ae370edff8ca7a11c453f10e1845ccf62b60718149215a2deaa9e5973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.14.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.14.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.0 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ece98c9b7cfdd903e4d14fde9449881cb0b946a823fe3c5f6c7ec11d6872c85f
BLAKE2b-256 checksum
How to use checksums
e7bdde0ef4c9c059fffe56a7f7566060926ef49bcc2b5814356a4541e9c38a3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.14.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.14.0-cp39-abi3-macosx_11_0_arm64.whl
Size 4.9 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f44c2fdd045c916ff5d8b3135d34e66296b46a7eb0efa0ac8738b80565f1361b
BLAKE2b-256 checksum
How to use checksums
155be53c4bbde777c78deb6c17f0be4af04641db8c0ea67bd920566afe35f9b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.14.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.14.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 5.3 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
db8ac0e334e70aa2280e12b300b2240107fa9850700bb900c921f5a69194a04a
BLAKE2b-256 checksum
How to use checksums
9df917bf0ea44c5f942215368c5a5a0b866e4cf6d5c0e0120049dfa469896d22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for xtalforge 1.14.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page