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.12.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.12.0
File Size Uploaded Provenance Actions
xtalforge-1.12.0.tar.gz 2.1 MB Without provenance Details for xtalforge-1.12.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for xtalforge 1.12.0
File Actions
xtalforge-1.12.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for xtalforge-1.12.0-cp39-abi3-win_amd64.whl
xtalforge-1.12.0-cp39-abi3-musllinux_1_1_x86_64.whl CPython 3.9 abi3 Linux musl 1.1+ x86-64 Details for xtalforge-1.12.0-cp39-abi3-musllinux_1_1_x86_64.whl
xtalforge-1.12.0-cp39-abi3-musllinux_1_1_aarch64.whl CPython 3.9 abi3 Linux musl 1.1+ ARM64 Details for xtalforge-1.12.0-cp39-abi3-musllinux_1_1_aarch64.whl
xtalforge-1.12.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.12.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
xtalforge-1.12.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for xtalforge-1.12.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
xtalforge-1.12.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for xtalforge-1.12.0-cp39-abi3-macosx_11_0_arm64.whl
xtalforge-1.12.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for xtalforge-1.12.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 35.3 MB

Release files / xtalforge-1.12.0.tar.gz

Download URL xtalforge-1.12.0.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c7155e5596732d2e305424a02a11f877f1e360908ed34c57a89672afb90d9ce8
BLAKE2b-256 checksum
How to use checksums
40218ab94250b50839a0b1f5e02a79c976fb9c344658ff5fde5034eda19e8fec
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.12.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.12.0-cp39-abi3-win_amd64.whl
Size 4.9 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f86a92c460df4d0bbd9fdb683efba70f899a8385eb0db61577733591f4e203a3
BLAKE2b-256 checksum
How to use checksums
abb84f4202ecabe819a8db4ec8ce9eb95da3f0dc43e76901114249f10c7f0b40
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.12.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.12.0-cp39-abi3-musllinux_1_1_x86_64.whl
Size 5.1 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
58beedd6d9507da56cdeae4ef3e176271827c2835071229d519e0725150267c5
BLAKE2b-256 checksum
How to use checksums
34283a2f6873aa4aa3f1d76e02258b94ec150a433f62b506b4355cd0799b9fd7
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.12.0-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.12.0-cp39-abi3-musllinux_1_1_aarch64.whl
Size 4.7 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
2d06f1f0ec28ad09c89fd793a03afb11546e648a1fb29070654c21890aed1417
BLAKE2b-256 checksum
How to use checksums
37157917bae397a509b160a2d498cc6a79513460c310df4c4a594dd9df75a1b2
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.12.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.12.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a73e71de54693e605d213f8038a9219263d478aee7f297004c5d0dfa753dba26
BLAKE2b-256 checksum
How to use checksums
842e2a9fd479876e1cce5b24558136483258479bcd0c76351a4aa89f7d1e6b7d
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.12.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.12.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3538b94b96a9f26d3fea580fb2a4a1673df5714a929003b1cd300bee33dba58d
BLAKE2b-256 checksum
How to use checksums
29f68436aad40825710cf9a4f671a797528614ba5cfb68cbaea9a1add4196662
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.12.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.12.0-cp39-abi3-macosx_11_0_arm64.whl
Size 4.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c36a099840d6bc11b8ebb8f411b096ed012df9a46ec70579534f4ca8d4ab2e95
BLAKE2b-256 checksum
How to use checksums
26ecc85bf9c07af562c0c7302192a0e44b95a80c2a4b0b570d06d62dcfa8d4ce
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.12.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.12.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 4.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a1428b054ce46e0aba40db20f0930aea8d154754e2776d89d9f375b302c8f65a
BLAKE2b-256 checksum
How to use checksums
52d502d388218d698bf86d4f4dc8f13390b8a8d364876a2693f2c002a78e38ce
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.12.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