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.10.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.10.0
File Size Uploaded Provenance Actions
xtalforge-1.10.0.tar.gz 1.9 MB Without provenance Details for xtalforge-1.10.0.tar.gz

Built distributions (wheels)

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

Total release size: 32.0 MB

Release files / xtalforge-1.10.0.tar.gz

Download URL xtalforge-1.10.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
5aa30ed64716d9a8f07dcdbffb51ecbc2c8b62b2cafb7f83f8c1ee7ed8381028
BLAKE2b-256 checksum
How to use checksums
7da0d73a43eab526855738fff524a7c3f467961392fa25d702d83c2175003bc5
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.10.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.10.0-cp39-abi3-win_amd64.whl
Size 4.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
920a05862c524738a39067eadb0bb1a39d624f3e2a56e8ab45e6aa88daa37f84
BLAKE2b-256 checksum
How to use checksums
dd95538c2c900c5063972fde63a218763e79bcecb87f8fa95b27ed7f00f22405
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.10.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.10.0-cp39-abi3-musllinux_1_1_x86_64.whl
Size 4.7 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
2d515ee0044bd03b02578850e624adcf6bb6359dd209de57c0e9c0045ec4a8d1
BLAKE2b-256 checksum
How to use checksums
6fa25d77c3e3828586bb19b70c7571acf7a2d911cd2f554fc138b6ab547ead7e
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.10.0-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.10.0-cp39-abi3-musllinux_1_1_aarch64.whl
Size 4.3 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
2038dddce82260e161a51510b5e2215f2c11e9ef6dd072ef1e66db5174c1298b
BLAKE2b-256 checksum
How to use checksums
a819b1112fc9292cf3c74af8379344571bcfc5bea459eed31d4b3ca5a30c2755
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.10.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.10.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8166477db92081a1b2e710bf00ec287466edb874011cac8998cb010d8f0c1adf
BLAKE2b-256 checksum
How to use checksums
8f369d42359cf7802842782f0f327fe3056e00e6dfbbf0bf81bc5c816336b5a6
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.10.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.10.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.1 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
fc339254c4cc8b0ec41a24b31908f18b5e054d73d66fd3a000a52cf89cadd104
BLAKE2b-256 checksum
How to use checksums
2a1bb925cab2c06bcf961f3054eb7e333405bbdd356744f8e785ec3e7d6048d0
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.10.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.10.0-cp39-abi3-macosx_11_0_arm64.whl
Size 4.0 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
166bd4b233b954f04132398ecc770ab492b5ff66fd3aa6ed4b400df98859bd6a
BLAKE2b-256 checksum
How to use checksums
27ddbb38363e63986db6686fcc3652caf5f48e8eacba5d319a645a01b97402db
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.10.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.10.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 4.3 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e696656ec3838e4a1274ed11e9767e328333c4fa48e573be7462753505e101dc
BLAKE2b-256 checksum
How to use checksums
881a07aedae617de086eefb8a6edce2615716c50745af75ae76566fd20ad6859
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.10.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