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.1

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.1
File Size Uploaded Provenance Actions
xtalforge-1.14.1.tar.gz 2.2 MB Without provenance Details for xtalforge-1.14.1.tar.gz

Built distributions (wheels)

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

Total release size: 104.7 MB

Release files / xtalforge-1.14.1.tar.gz

Download URL xtalforge-1.14.1.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
f35004803d00e7079797deaf7e2d32bc97daff172a30ec5d992a97d120d1eb65
BLAKE2b-256 checksum
How to use checksums
9ee6f012527177ab1e08e37e8bc86a1704b12ecf11e93611f01f7acc562fc5f1
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.1-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.14.1-cp39-abi3-win_amd64.whl
Size 15.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
bffa09c1c6414156fbd608fcd150b70ce66fe437bd905e433beab6d98be749ff
BLAKE2b-256 checksum
How to use checksums
8fbc024d1ccae654b2ebebdf981e3259dead9bd7a24a7a4a3f5104457d008339
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.1-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.14.1-cp39-abi3-musllinux_1_1_x86_64.whl
Size 15.7 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
a726601061abcec2e86feaa767db0fbf05b7581c3d3b6881d53007877d682686
BLAKE2b-256 checksum
How to use checksums
057ff75a9866e16f360d9568b19e683d2c2f2897252b918bb666a8a9d066513f
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.1-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.14.1-cp39-abi3-musllinux_1_1_aarch64.whl
Size 14.2 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
31ea1d75e95cf18ba706aa767eff0ac044416b4b89af02bc2107c7b1ace669f8
BLAKE2b-256 checksum
How to use checksums
2562f678f626057206de03fa96ce53e424c2662e246ff25e14db574cfd5f4562
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.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.14.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 15.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c50d356a5e3ad7fa36448523c31e1cbe3ae917133f74d40f0946c7f76abde793
BLAKE2b-256 checksum
How to use checksums
61b2e58e6c78767b0661b2d6ac6977d5a26559cae6af96b306c4e9a2fa5e3c3b
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.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.14.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 14.0 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a7f983678a94d31810069a8a48ce063098d9665501a094d396d02883f0850db3
BLAKE2b-256 checksum
How to use checksums
b8e6d97ffdc819038cf594d580dff99047d1104e34c1bfc296de099332d6646b
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.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.14.1-cp39-abi3-macosx_11_0_arm64.whl
Size 13.3 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
64ca07440acf9dd6bcb5bb0375bc41309671c027fc8d21f40c6dce26aa94e35f
BLAKE2b-256 checksum
How to use checksums
7207e4f5c8d177f470e2f2a49c0dcdefe2df240bc1e0ecf1c2789223e1878954
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.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.14.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 14.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e6b4dfecbc89c8326d9df64c06a2e3db31d5aad180bfe297736397b9e5264ee9
BLAKE2b-256 checksum
How to use checksums
16160ef0b83e31e54f7d186cc6f4eb3d61b144ffe2573d6dc3412dde65fda721
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.1

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